Categories:
.NET (961)
C (387)
C++ (185)
CSS (84)
DBA (8)
General (31)
HTML (48)
Java (641)
JavaScript (220)
JSP (109)
JUnit (31)
MySQL (297)
Networking (10)
Oracle (562)
Perl (48)
Perl (9)
PHP (259)
PL/SQL (140)
RSS (51)
Software QA (28)
SQL Server (5)
Struts (20)
Unix (2)
Windows (3)
XHTML (199)
XML (59)
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, 1514👍, 0💬
Popular Posts:
What will the following piece of code do? int f(unsigned int x) { int i; for (i=0; x!=0; x>&a...
What does a special set of tags <?= and ?> do in a PHP script page? <?= express...
What are unadjusted function points and how is it calculated? Unadjusted function points = ILF + EIF...
What are unadjusted function points and how is it calculated? Unadjusted function points = ILF + EIF...
Can we get a strongly typed resource class rather than using resource manager? In the previous quest...