5
Reply

difference between response.write and response.output.write

esk

esk

17y
27.2k
0
Reply

    Ref this example for scott : http://www.hanselman.com/blog/ASPNETResponseWriteAndResponseOutputWriteKnowTheDifference.aspx

    Response.Write() and Response.Output.Write() both are used for print output on the screen. But their are is a difference between both of them1. 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 writeResponse.Write(".Net{0},"ASP"); // Its Wrong2. As Per Asp.Net 3.5, Response.Write() Has 4 overloads, with Response.Output.Write() has 17 overloads.

    Hi chand, pl refer this one. http://stackoverflow.com/questions/1794792/what-s-the-difference-between-response-write-andresponse-output-write

    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/

    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