What is the main use of Response.Output.Write()?
Answer Posted / varun
In ASP.NET the Response object is of type HttpResponse and
when you say Response.Write you're really saying
(basically) HttpContext.Current.Response.Write and calling
one of the many overloaded Write methods of HttpResponse.
Response.Write then calls .Write() on it's internal
TextWriter object:
public void Write(object obj){ this._writer.Write(obj);}
HttpResponse also has a Property called Output that is of
type, yes, TextWriter, so:
public TextWriter get_Output(){ return this._writer; }
Which means you can to the Response whatever a TextWriter
will let you. Now, TextWriters support a Write() method
ala String.Format, so you can do this:
Response.Output.Write("Scott is {0} at
{1:d}", "cool",DateTime.Now);
But internally, of course, this this is happening:
public virtual void Write(string format, params object[]
arg)
{
this.Write(string.Format(format, arg));
}
Is This Answer Correct ? | 10 Yes | 1 No |
Post New Answer View All Answers
How can you identify that the page is post back?
5. What three Specific Job Positions do you target from Swatz Oils GROUP U.K?
How many validators do ASP.NET have?
Can you use Web API with ASP.NET Web Form?
Why mvc is better than asp.net? : Asp.Net MVC
Why session management is required?
Define a multilingual website?
What is a viewbag?
What is the importance of Global.asax in ASP.NET?
What are the modes of updation in an updatepanel?
What is postback request?
What are the two Layouts supported by a Web form in ASP.NET?
there is two functions function a and function b like fun a(){.... ..... } fun b() { } in function b i write the coding to add two numbers and i need to dispaly the sum result in function a with out using global variable. how we do?
How to deploy/publish webservices?How many ways?Plz explain me
How can we create pie chart in asp.net?