By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,715 Members | 1,815 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,715 IT Pros & Developers. It's quick & easy.

Response.Redirect not working

P: n/a
I get an error - any help appreciated.

System.Threading.ThreadAbortException: Thread was being aborted. 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
WebApplication1.WebForm4.DropDownList1_SelectedInd exChanged(Object sender,
EventArgs e) in c:\inetpub\wwwroot\WebApplication1\WebForm4.aspx.v b:line 150
Nov 19 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
Yeah, You can ignore this exception. It's how it's implemented.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I get an error - any help appreciated.

System.Threading.ThreadAbortException: Thread was being aborted. 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
WebApplication1.WebForm4.DropDownList1_SelectedInd exChanged(Object
sender, EventArgs e) in
c:\inetpub\wwwroot\WebApplication1\WebForm4.aspx.v b:line 150


Nov 19 '05 #2

P: n/a
Thanks but I get a blank white page.

"Brock Allen" wrote:
Yeah, You can ignore this exception. It's how it's implemented.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I get an error - any help appreciated.

System.Threading.ThreadAbortException: Thread was being aborted. 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
WebApplication1.WebForm4.DropDownList1_SelectedInd exChanged(Object
sender, EventArgs e) in
c:\inetpub\wwwroot\WebApplication1\WebForm4.aspx.v b:line 150


Nov 19 '05 #3

P: n/a
What is your catch block doing?

-Brock
DevelopMentor
http://staff.develop.com/ballen
Thanks but I get a blank white page.

"Brock Allen" wrote:
Yeah, You can ignore this exception. It's how it's implemented.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I get an error - any help appreciated.

System.Threading.ThreadAbortException: Thread was being aborted. 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
WebApplication1.WebForm4.DropDownList1_SelectedInd exChanged(Object
sender, EventArgs e) in
c:\inetpub\wwwroot\WebApplication1\WebForm4.aspx.v b:line 150


Nov 19 '05 #4

P: n/a
Are you Response.Redirecting inside a try/catch?

You probably need to modify your Response.Redirect to be like this

Response.Redirect("redirec.aspx", false)

The "false" tells it to wait to finish the execution of the current request
before doing the Redirect.

Hope this helps,

Chris
"Niggy" wrote:
I get an error - any help appreciated.

System.Threading.ThreadAbortException: Thread was being aborted. 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
WebApplication1.WebForm4.DropDownList1_SelectedInd exChanged(Object sender,
EventArgs e) in c:\inetpub\wwwroot\WebApplication1\WebForm4.aspx.v b:line 150

Nov 19 '05 #5

P: n/a
I have tried Response.Redirect("index.htm", false) and have taken the code
out of a try catch statement, but I get no response or a blank page.

"Chris" wrote:
Are you Response.Redirecting inside a try/catch?

You probably need to modify your Response.Redirect to be like this

Response.Redirect("redirec.aspx", false)

The "false" tells it to wait to finish the execution of the current request
before doing the Redirect.

Hope this helps,

Chris
"Niggy" wrote:
I get an error - any help appreciated.

System.Threading.ThreadAbortException: Thread was being aborted. 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
WebApplication1.WebForm4.DropDownList1_SelectedInd exChanged(Object sender,
EventArgs e) in c:\inetpub\wwwroot\WebApplication1\WebForm4.aspx.v b:line 150

Nov 19 '05 #6

P: n/a
Hmmm.

This is indeed perplexing. Can you post the method/function that you have
this code in? I'd like to try it out in my dev environment and see if I can
find something.

Chris

"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:F2**********************************@microsof t.com...
I have tried Response.Redirect("index.htm", false) and have taken the code
out of a try catch statement, but I get no response or a blank page.

"Chris" wrote:
Are you Response.Redirecting inside a try/catch?

You probably need to modify your Response.Redirect to be like this

Response.Redirect("redirec.aspx", false)

The "false" tells it to wait to finish the execution of the current
request
before doing the Redirect.

Hope this helps,

Chris
"Niggy" wrote:
> I get an error - any help appreciated.
>
> System.Threading.ThreadAbortException: Thread was being aborted. 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
> WebApplication1.WebForm4.DropDownList1_SelectedInd exChanged(Object
> sender,
> EventArgs e) in
> c:\inetpub\wwwroot\WebApplication1\WebForm4.aspx.v b:line 150

Nov 19 '05 #7

P: n/a
I have a DDL with Text and Value populated by a database. An example value
entry would be "../4900/Framework.doc". The code is:

Private Sub DropDownList1_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
DropDownList1.SelectedIndexChanged

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring(3, pos - 3))
Dim cString As String=http://localhost/ & bString
Response.Redirect(cString)

End Sub

Hope you can come up with an answer. Thanks.

"Chris Hayes" wrote:
Hmmm.

This is indeed perplexing. Can you post the method/function that you have
this code in? I'd like to try it out in my dev environment and see if I can
find something.

Chris

"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:F2**********************************@microsof t.com...
I have tried Response.Redirect("index.htm", false) and have taken the code
out of a try catch statement, but I get no response or a blank page.

"Chris" wrote:
Are you Response.Redirecting inside a try/catch?

You probably need to modify your Response.Redirect to be like this

Response.Redirect("redirec.aspx", false)

The "false" tells it to wait to finish the execution of the current
request
before doing the Redirect.

Hope this helps,

Chris
"Niggy" wrote:

> I get an error - any help appreciated.
>
> System.Threading.ThreadAbortException: Thread was being aborted. 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
> WebApplication1.WebForm4.DropDownList1_SelectedInd exChanged(Object
> sender,
> EventArgs e) in
> c:\inetpub\wwwroot\WebApplication1\WebForm4.aspx.v b:line 150


Nov 19 '05 #8

P: n/a
Well, I'm not quite sure what's causing your Response.Redirect problem... I
took your code as a base (I had to tweak it a little bit) but it works just
fine...

Here's the tweaked code:
Private Sub DropDownList1_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
DropDownList1.SelectedIndexChanged

Dim sumfin As String = DropDownList1.SelectedValue.ToString()

Dim pos As Integer = sumfin.Length

Dim bString As String = sumfin.Substring(3, pos - 3)

Dim cString As String = "http://localhost/" & bString

Response.Redirect(cString)

End Sub
"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:1E**********************************@microsof t.com...
I have a DDL with Text and Value populated by a database. An example value
entry would be "../4900/Framework.doc". The code is:

Private Sub DropDownList1_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
DropDownList1.SelectedIndexChanged

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring(3, pos - 3))
Dim cString As String=http://localhost/ & bString
Response.Redirect(cString)

End Sub

Hope you can come up with an answer. Thanks.

"Chris Hayes" wrote:
Hmmm.

This is indeed perplexing. Can you post the method/function that you have
this code in? I'd like to try it out in my dev environment and see if I
can
find something.

Chris

"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:F2**********************************@microsof t.com...
>I have tried Response.Redirect("index.htm", false) and have taken the
>code
> out of a try catch statement, but I get no response or a blank page.
>
> "Chris" wrote:
>
>> Are you Response.Redirecting inside a try/catch?
>>
>> You probably need to modify your Response.Redirect to be like this
>>
>> Response.Redirect("redirec.aspx", false)
>>
>> The "false" tells it to wait to finish the execution of the current
>> request
>> before doing the Redirect.
>>
>> Hope this helps,
>>
>> Chris
>>
>>
>> "Niggy" wrote:
>>
>> > I get an error - any help appreciated.
>> >
>> > System.Threading.ThreadAbortException: Thread was being aborted. 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
>> > WebApplication1.WebForm4.DropDownList1_SelectedInd exChanged(Object
>> > sender,
>> > EventArgs e) in
>> > c:\inetpub\wwwroot\WebApplication1\WebForm4.aspx.v b:line 150


Nov 19 '05 #9

P: n/a
I've been seeing the same problem on a few of our projects, and don't know
the actual cause. I do have my suspicions that it is a cache problem in IIS.

Occasionally a page calling Repose.Redirect will just sit there with the old
URL in the location bar, and display a blank page. Sometime later it will
(usually) start to work properly. It happens intermittently. A page will
sometimes stop working for a few hours, then start working again, with no
apparent reason for stopping or starting back up.

All attempts at debugging it on the application side have failed, and I
don't really care for our people to spend time debugging into IIS to find yet
another Microsoft bug -- I'm tired of us spending developer salaries to give
MS more free bug reports.

It seems to happen more frequently (and vanish more quickly) on the SSL
production site. Also, it happens frequently when a developer changes a page
or the code behind it on the dev machines, although in that case we have a
possible reason for the problem -- and a possible cache coherency issue.

Bryan Wagstaff
Lead Programmer

"Chris Hayes" wrote:
Well, I'm not quite sure what's causing your Response.Redirect problem... I
took your code as a base (I had to tweak it a little bit) but it works just
fine...

Nov 19 '05 #10

P: n/a
Hi Niggy,

I got a workaround to get over this. What I did was instead of running it
from the called procedure, I created a statement in calling procedure (that
is btn1_click event). And it started working.

Raj

"Niggy" wrote:
I get an error - any help appreciated.

System.Threading.ThreadAbortException: Thread was being aborted. 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
WebApplication1.WebForm4.DropDownList1_SelectedInd exChanged(Object sender,
EventArgs e) in c:\inetpub\wwwroot\WebApplication1\WebForm4.aspx.v b:line 150

Nov 19 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.