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, 2005👍, 0💬
Popular Posts:
Can event’s have access modifiers ? Event’s are always public as they are meant to serve every one r...
Why is there extra white space before or after tables? This is often caused by invalid HTML syntax. ...
How To Display a Past Time in Days, Hours and Minutes? - MySQL FAQs - Managing Tables and Running Qu...
What is DAR (Decision Analysis and Resolution) ? Decision Analysis and Resolution is to analyze poss...
Is Session_End event supported in all session modes ? Session_End event occurs only in “Inproc mode”...