HttpContext.Current.Response.Redirect

  • Thread starter Thread starter Peter Kirk
  • Start date Start date
P

Peter Kirk

Hi there

I have a program written by another company (it's a "web control" which
returns a web-page: can I compare this to a servlet in the Java world?),
which they think is causing problems on their server.

But no-one really knows if this program is at fault because the problem only
exhibits itself every once and a while, and the only thing they can see is
that their web-users suddenly stop receiving responses.

Anyway, at some points in this program it does this:
HttpContext.Current.Response.Redirect(redirect);
where redirect is a string which has the value "/style.css".

This causes an exception like:
Exception: System.Threading.ThreadAbortException
Message: Tråden var ved at blive afbrudt. (the thread was about to be
interrupted?)
Source: mscorlib
at System.Threading.Thread.AbortInternal()
at System.Threading.Thread.Abort(Object stateInfo)
at System.Web.HttpResponse.End()
at System.Web.HttpResponse.Redirect(String url, Boolean endResponse)
at System.Web.HttpResponse.Redirect(String url)
at InfoWeb.Net.FetchHandler.Handle(HttpRequest request, HtmlTextWriter
output)
at InfoWeb.Net.InfoWebControl.Render(HtmlTextWriter output)

What does it mean to redirect to a "css"? And what does the exception mean?
I don't really know if this is a part of the bigger problem because the
program continues quite happily afterwards - servicing requests.

Thanks,
Peter
 
Peter said:
Hi there

I have a program written by another company (it's a "web control"
which returns a web-page: can I compare this to a servlet in the Java
world?), which they think is causing problems on their server.

But no-one really knows if this program is at fault because the
problem only exhibits itself every once and a while, and the only
thing they can see is that their web-users suddenly stop receiving
responses.
Anyway, at some points in this program it does this:
HttpContext.Current.Response.Redirect(redirect);
where redirect is a string which has the value "/style.css".

This causes an exception like:
Exception: System.Threading.ThreadAbortException
Message: Tråden var ved at blive afbrudt. (the thread was about to be
interrupted?)
Source: mscorlib
at System.Threading.Thread.AbortInternal()
at System.Threading.Thread.Abort(Object stateInfo)
at System.Web.HttpResponse.End()
at System.Web.HttpResponse.Redirect(String url, Boolean endResponse)
at System.Web.HttpResponse.Redirect(String url)
at InfoWeb.Net.FetchHandler.Handle(HttpRequest request,
HtmlTextWriter output)
at InfoWeb.Net.InfoWebControl.Render(HtmlTextWriter output)

What does it mean to redirect to a "css"? And what does the exception
mean? I don't really know if this is a part of the bigger problem
because the program continues quite happily afterwards - servicing
requests.
Thanks,
Peter

This exception will occur if that redirect is done from within a try/catch.
This is expected behaviour. You can ignore it or (better) have that other
company move the redirect out of the try/catch.

A redirect to a css looks odd, but is not impossible. The question is
*why* does it do that redirect.

By the way: a better place to post aspnet related questions is in the
microsoft.public.dotnet.framework.aspnet group.

Hans Kesting
 
Back
Top