Answer:
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);
Asked In: Many Interviews |
Alert Moderator