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
What is smpte vc-1?
Explain MVC model binders?
Can you nest updatepanel within each other?
Differentiate between authentication and authorization.
What are url fragments?
What are uri parameters?
How you will handle session when deploying application in more than a server?
To wrap up a call to a Web service the standard used is..?
What is the usie of activex control in .net?
Which method do you use to enforce garbage collection in .net?
Explain model, view and controller represent in an mvc application? : asp.net mvc
What is latest version of asp.net mvc? : Asp.Net MVC
Differentiate between structure and class.
Explain how do you validate the controls in an asp .net page?
what is DLL Hell and how it is solved in .NET? please explain clearly??