Difference between Response.Write and Response.Output.Write

 Posted by Ddd on 3/2/2011 | Category: ASP.NET Interview questions | Views: 44299 | Points: 40

Response.Write and Response.Output.Write are both used to write messages on the screen

1)Response.Output.Write allows us to write a more formatted output:

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);

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Jmckamal on: 3/27/2012 | Points: 10
good explanation. we need this kind of explanations to understand things better.

Login to post response