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, 2109👍, 0💬
Popular Posts:
In C#, what is a weak reference? Generally, when you talk about a reference to an object in .NET (an...
What is Traceability Matrix? Traceability Matrix is one of the document will prepare by QA.To make s...
What is hashing? To hash means to grind up, and that's essentially what hashing is all about. The he...
How can we implement singleton pattern in .NET? Singleton pattern mainly focuses on having one and o...
How do you target a specific frame from a hyperlink? Include the name of the frame in the target att...