Hey Dave,
Bruce is right , there is no problem here. Just a by design behavior
because manually end asp.net response need to abort the current working
thread... Just not catch this exception or if you've used try-catch ..
block, ignore it....
thanks,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Thread-Topic: Write entire page from code behind
| thread-index: AcYBFaxmJzKPFxOZT0KhA0PS384ikQ==
| X-WBNR-Posting-Host: 199.45.247.98
| From: "=?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=" <
[email protected]>
| References: <
[email protected]>
<
[email protected]>
| Subject: Re: Write entire page from code behind
| Date: Wed, 14 Dec 2005 17:20:02 -0800
| Lines: 39
| Message-ID: <
[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:364979
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hi;
|
| If I make it the last line of code in my method, then no exception. Is
that
| by design? And if so, that's the solution.
|
| --
| thanks - dave
|
|
| "Bruce Barker" wrote:
|
| > nothing. Response.End() works by aborting the current thread, to stop
| > furthor processimng. don't catch this error.
| >
| > -- bruce (sqlwork.com)
| >
| > | > > Hi;
| > >
| > > I have a page where the file.aspx.cs Page_Load() method writes the
entire
| > > contents out directly. I use this to write a pdf or rtf file as the
web
| > > page
| > > to display.
| > >
| > > In .net 1.1 the way I did this was:
| > > Response.ContentType = contentType;
| > > Response.BinaryWrite(((MemoryStream)proc.GetReport()).ToArray());
| > > Response.End();
| > > return;
| > >
| > > This does display the page, but the call to Response.End() throws a
| > > ThreadAbortException. What am I doing wrong?
| > >
| > > --
| > > thanks - dave
| >
| >
| >
|