Sunday, March 16, 2008

TIPS : Difference between Response.Write and Response.Output.Write

The Respose.Write() : just outputs a string to web page and it writes the text stream.

Response.Output.Write() : formats the string as per specified options before writing to the the web page and it gives you String.Format - style formatted output and it writes the HTTP Output Stream.

FOR Example:
Response.Write("Current Date Time is " + DateTime.Now.ToString() ); 
Response.Output.Write ("{0} is {1:d}", "Current Date Time is: ", DateTime.Now);

Hope this will help you!!!