Interviews5 answers
5 Answers
Ref this example for scott : http://www.hanselman.com/blog/ASPNETResponseWriteAndResponseOutputWriteKnowTheDifference.aspx
Rajeesh MenothPosted Aug 17, 2015, 8:35 AM EDT
Response.Write() and Response.Output.Write() both are used for print output on the screen.
But their are is a difference between both of them
1. Response.Output.Write() is allows us to print formatted output but Response.Write() can't allows the formatted output.
Example:
Response.Output.Write(".Net{0},"ASP"); // Its write
Response.Write(".Net{0},"ASP"); // Its Wrong
2. As Per Asp.Net 3.5, Response.Write() Has 4 overloads, with Response.Output.Write()
has 17 overloads.
Upendra Pratap ShahiPosted Aug 17, 2015, 8:01 AM EDT
Hi chand, pl refer this one.
http://stackoverflow.com/questions/1794792/what-s-the-difference-between-response-write-andresponse-output-write
Anand VigneshPosted Aug 11, 2015, 3:52 AM EDT
Response.Output.Write() gives you String.Format-style formatted output and the Response.Write() doesn't.
FOR Example
Response.Write("Current Date Time is "+DateTime.Now.ToString());
Response.Output.Write("{0} is {1:d}", "Current Date Time is: ",DateTime.Now);
Thanks
Gurjinder Singh Brar
http://agileguru.blogspot.com/
FOR Example
Response.Write("Current Date Time is "+DateTime.Now.ToString());
Response.Output.Write("{0} is {1:d}", "Current Date Time is: ",DateTime.Now);
Thanks
Gurjinder Singh Brar
http://agileguru.blogspot.com/
Gurjinder Singh BrarPosted Jan 31, 2007, 6:37 AM EST
The respose.write just outputs a string to webpage. Response.Output.Write formats the string as per specified options before writing to the the webpage
James RajaPosted Jan 31, 2007, 4:31 AM EST


