Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the main use of Response.Output.Write()?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the question mark in a url?

959


Can we make activex dll also ti execute in some process as that of client ? How can we do?

4748


Is post back in asp.net?

959


What is the advantage of using Windows authentication in a Web application?

1107


What is latest version of asp.net mvc? : Asp.Net MVC

1078


Explain the difference between value type and reference type?

664


Define the types of configuration files.

983


What are ASP.NET Web Forms? How is this technology different than what is available though ASP?

1664


What is the typical session identifier?

1042


What are the disadvantages of asp.net?

1087


What is difference between View State and Hidden Field in ASP.NET?

1145


What is difference between singleton and single call?

1094


What is asp according to you?

1041


What is asp net_sessionid?

1103


Describe the diffeerence between inline and code behind?

1030