Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
What is the Differnce Between Response.write & response.output.Write
What is the Differnce Between Response.write & response.output.Write
✍: Guest
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));
}
2013-12-24, 1645👍, 0💬
Popular Posts:
Advantages of a macro over a function? Macro gets to see the Compilation environment, so it can expa...
What invokes a thread's run() method? After a thread is started, via its start() method of the Threa...
What is the quickest sorting method to use? The answer depends on what you mean by quickest. For mos...
Can two catch blocks be executed? No, once the proper catch section is executed the control goes fin...
Can you explain what is “AutoPostBack” feature in ASP.NET ? If we want the control to automatically ...