I looked at the IL for both Clear and ClearContent and ClearContent
calls Clear. So, they do the same thing. Here's the C# code from
Anakrino:
public void Clear() {
if (this.UsingHttpWriter)
this._httpWriter.ClearBuffers();
}
public void ClearContent() {
this.Clear();
}
---
Patrick Steele ([EMAIL PROTECTED])
Lead Software Architect
Image Process Design
-----Original Message-----
From: Thomas V. Nielsen [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 08, 2002 5:21 AM
To: dotnet
Subject: RE: Catch the output stream
Okay I am a bit confused now.
According to the tooltip
Response.Clear(); Clears all content output from the buffer stream.
Response.ClearContent(); Clears all content output from the buffer
stream.
??!? So what's the difference.
But I take that it means, that any headers written, like:
Response.AddHeader("Content-Disposition", "Attachment;
filename="+m_sCatalogName+".xml");
Response.ContentType = "application/x-msdownload";
Will still be there, when I do a Response.Clear();
<Thomas/>
> -----Original Message-----
> From: Thomas V. Nielsen [mailto:[EMAIL PROTECTED]]
> Sent: 8. oktober 2002 09:44
> To: dotnet
> Subject: RE: Catch the output stream
>
>
> Yup, I did thought of Response.Clear(); but the problem was,
> that I allready
> had made some headers like
>
> Response.ContentType = "text/xml";
>
> So I was playing arround with:
> long lBegin = Response.OutputStream.Position;
>
> And the setting the position to lBegin, instead of clear.
>
> It is not nice, so I am thinking of refactoring my code, and
> make a header
> function to be called instead.
>
> <Thomas/>
>
>
> > -----Original Message-----
> > From: Paul Brinkley-Rogers [mailto:[EMAIL PROTECTED]]
> > Sent: 7. oktober 2002 20:09
> > To: dotnet
> > Subject: RE: Catch the output stream
> >
> >
> > catch(Exception err)
> > {
> > Response.Clear();
> > Response.Write("<?xml version='1.0' ?>");
> > Response.Write("<error>");
> > writeErrorException(err);
> > Response.Write("</error>");
> > ssSql.Close();
> > return;
> > }
> > ______________________
> > Paul Brinkley-Rogers
> > Web Developer
> > The Sak
> > [EMAIL PROTECTED]
> > http://www.thesak.com
> >
> >
> >
> > -----Original Message-----
> > From: Thomas V. Nielsen [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, October 07, 2002 6:44 AM
> > To: dotnet
> > Subject: Catch the output stream
> >
> > I have an object which I Serialize to XML using the
> XmlTextWriter and
> > sending the output directly to the Response.OutoutStream.
> >
> > However, if the Serialization fails for some reasion, I end
> up with a
> > half
> > serialized XML document, and my:
> >
> > catch(Exception err)
> > {
> > Response.Write("<?xml version='1.0' ?>");
> > Response.Write("<error>");
> > writeErrorException(err);
> > Response.Write("</error>");
> > ssSql.Close();
> > return;
> > }
> >
> > Which is a bit useless. What I need to do is to change what
> > is allready
> > in
> > the OutputStream, and replace it with my error response.
> Otherwise the
> > systen in the other end, think it is some perfectly
> formated xml it is
> > getting, but it is not.
> >
> > <Thomas/>
> >
> > ---
> > You are currently subscribed to dotnet as: [EMAIL PROTECTED]
> > To unsubscribe send a blank email to
> > %%email.unsub%%
> >
> > ---------
> > Administrated by 15 Seconds : http://www.15Seconds.com
> > List Archives/Search : http://local.15Seconds.com/search
> > Subscription Information : http://www.15seconds.com/listserv.htm
> > Advertising Information: http://www.internet.com/mediakit/
> >
> >
> >
> > ---
> > You are currently subscribed to dotnet as: [EMAIL PROTECTED]
> > To unsubscribe send a blank email to
> > %%email.unsub%%
> >
> > ---------
> > Administrated by 15 Seconds : http://www.15Seconds.com
> > List Archives/Search : http://local.15Seconds.com/search
> > Subscription Information : http://www.15seconds.com/listserv.htm
> > Advertising Information: http://www.internet.com/mediakit/
> >
> >
>
> ---
> You are currently subscribed to dotnet as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to
> %%email.unsub%%
>
> ---------
> Administrated by 15 Seconds : http://www.15Seconds.com
> List Archives/Search : http://local.15Seconds.com/search
> Subscription Information : http://www.15seconds.com/listserv.htm
> Advertising Information: http://www.internet.com/mediakit/
>
>
---
You are currently subscribed to dotnet as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
%%email.unsub%%
---------
Administrated by 15 Seconds : http://www.15Seconds.com
List Archives/Search : http://local.15Seconds.com/search
Subscription Information : http://www.15seconds.com/listserv.htm
Advertising Information: http://www.internet.com/mediakit/
---
You are currently subscribed to dotnet as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
---------
Administrated by 15 Seconds : http://www.15Seconds.com
List Archives/Search : http://local.15Seconds.com/search
Subscription Information : http://www.15seconds.com/listserv.htm
Advertising Information: http://www.internet.com/mediakit/