What’s the difference between Response.Write()
and Response.Output.Write()
?

- 10,475
- 4
- 48
- 75
-
See a more complete answer at [here](http://stackoverflow.com/a/1794809/3834) – Graviton Feb 14 '14 at 05:55
4 Answers
They both write to the output stream using a TextWriter
(not directly to a Stream), however using HttpContext.Response.Output.Write
offers more overloads (17 in Framework 2.0, including formatting options) than HttpContext.Response.Write
(only 4 with no formatting options).
The HttpResponse
type does not allow direct 'set' access to its output stream.
Nothing really.
But. Response.Write
takes the stream in the Response.Output
property. You could set another Output stream, and in that way instead of writing back to the client, maybe write to a file or something crazy. So thats there relation.

- 10,475
- 4
- 48
- 75

- 2,751
- 17
- 16
Response.Output.Write()
: It is used to display any type of data like int, date, string etc. i.e. It displays the formatted output.
Response.Write()
: To display only string type of data i.e. It's can't display formatted output().
To display formatted output from Response.Write()
you can write:
Response.Write(String.Format(" ",___));