How do you construct HtmlResponseMessage?
Answer / nirav desai
Following is the way to construct to do so,
public class TestController : ApiController
{
public HttpResponseMessage Get()
{
HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, "value");
response.Content = new StringContent("Testing", Encoding.Unicode);
response.Headers.CacheControl = new CacheControlHeaderValue()
{
MaxAge = TimeSpan.FromMinutes(20)
};
return response;
}
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Describe the Server Control Events of ASP.NET?
0 Answers SwanSoft Technologies,
1. What is the difference between Cache and Session? 2. I cache limited to page like viewstate or it's accessible through out the application like session? 3. Which one is better when I've some data that is to be used across the application? Why is to better than the other?
Why Unload event of MasterPage Calls first in ASP.net ?
Explain the difference between asp & asp.net.
Which type if caching will be used if we want to cache the portion of a page instead of whole page?
What is a PostBack ?
main difference between asp.net2.0,asp.net1.1,asp.net1.0
which is best possible way to add data source to data grid when the data is huge(10 lack recored)how to edit a perticular row
What are the various ways to send content from one page to another?
Explain login control and form authentication.
What is .net framework and what are the main components of it?
what is diffrance between response.write & response.output.write
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)