What is the difference between Response.Write() and Response.Output.Write() ?
Response.Write() and Response.Output.Write()
Hi
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted May 5, 2012, 5:19 AM
Response.Write and Response.Output.Write are both used to write messages on the screen
Difference:
1)Response.Output.Write allows us to write a more formatted output:
example:
Response.Output.Write("hello {0}", "asp.net");
//It is Ok
But, Response.Write("hello {0}","asp.net");
//It is wrong
2) As per ASP.NET 3.5, Response.Write has 4 overloads, while Response.Output.Write has 17 overloads.
example: To write integer,double, boolean values using Response.Write, we are
provided with one overloaded version:-> Response.Write(object obj);
To do the same thing using Response.Output.Write, we are provided with separate
overloaded versions :
ex:1) Response.Output.Write(int s);
2) Response.Output.Write(double s);
3) Response.Output.Write(bool b);
Thanks