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

Which object is used to encapsulate the state of the client and the browser in ASP.NET?

1056


What is the difference between localization and globalization?

988


What are the different types of cookies in asp.net?

986


What is session and application variable in asp net?

871


What are the types of session in asp.net?

930


Will the asp.net validators run in server side or client side?

1108


What is the compiled object?

2024


Why do we use datasource in asp.net?

932


Is viewstate secure?

924


What is the difference between cookie and session?

951


What types of data validation events are commonly seen in the client-side form validation?

940


In a page I have gridview with options of select and delete using hyperlink when I am selecting any one of then it has to open another page how can it?

882


When you are running a component within ASP.NET, what process is it running within on Windows XP? Windows 2000? Windows 2003?

1025


How do you use viewstate?

956


Explain swagger components.

946