What is the main use of Response.Output.Write()?
Answers were Sorted based on User's Feedback
Answer / psetty
To write formatted output Response.Output.Write() function
is used.
Is This Answer Correct ? | 23 Yes | 3 No |
Answer / varun
In ASP.NET the Response object is of type HttpResponse and
when you say Response.Write you're really saying
(basically) HttpContext.Current.Response.Write and calling
one of the many overloaded Write methods of HttpResponse.
Response.Write then calls .Write() on it's internal
TextWriter object:
public void Write(object obj){ this._writer.Write(obj);}
HttpResponse also has a Property called Output that is of
type, yes, TextWriter, so:
public TextWriter get_Output(){ return this._writer; }
Which means you can to the Response whatever a TextWriter
will let you. Now, TextWriters support a Write() method
ala String.Format, so you can do this:
Response.Output.Write("Scott is {0} at
{1:d}", "cool",DateTime.Now);
But internally, of course, this this is happening:
public virtual void Write(string format, params object[]
arg)
{
this.Write(string.Format(format, arg));
}
Is This Answer Correct ? | 10 Yes | 1 No |
Answer / varun
The difference between Response.Write() and
Response.Output.Write() in ASP.NET. The short answer is
that the latter gives you String.Format-style output and
the former doesn't. The long answer follows.
Is This Answer Correct ? | 9 Yes | 2 No |
What are the new web part controls in asp.net 2.0 ?
What is smpte vc-1?
when using personlization, how do you access over setting at runtime?
What is the equivalent of date() and time() in asp.net?
Is asp.net mvc front end or backend? : Asp.Net MVC
Is there any property names “isnavigating”?
if i have 1000 records and i want to access 20 ata time from SQL server, what will be the query?
What is meant by ispostback in asp net?
Explain the difference between codebehind="mycode.aspx.cs" and src="mycode.aspx.cs"?
what are the levels of securities need to be considered for the finincial web application?
How can we provide the WebParts control functionality to a server control?
Name the two properties are on every validation control?