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, 1714👍, 0💬
Popular Posts:
What will be printed as the result of the operation below: main() { char *p1; char *p2; p1=(char *)m...
What will be printed as the result of the operation below: main() { int x=20,y=35; x=y++ + x++; y= +...
What are some uses of Intranets & Extranets? An "intranet" is the generic term for a collect...
How To Get the Uploaded File Information in the Receiving PHP Script? Once the Web server received t...
Is Session_End event supported in all session modes ? Session_End event occurs only in “Inproc mode”...