Response.Redirect not working

Discussion in 'ASP .Net' started by =?Utf-8?B?TmlnZ3k=?=, Jul 26, 2005.

  1. 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_SelectedIndexChanged(Object sender,
    EventArgs e) in c:\inetpub\wwwroot\WebApplication1\WebForm4.aspx.vb:line 150
    =?Utf-8?B?TmlnZ3k=?=, Jul 26, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?TmlnZ3k=?=

    Brock Allen Guest

    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_SelectedIndexChanged(Object
    > sender, EventArgs e) in
    > c:\inetpub\wwwroot\WebApplication1\WebForm4.aspx.vb:line 150
    >
    Brock Allen, Jul 26, 2005
    #2
    1. Advertising

  3. 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_SelectedIndexChanged(Object
    > > sender, EventArgs e) in
    > > c:\inetpub\wwwroot\WebApplication1\WebForm4.aspx.vb:line 150
    > >

    >
    >
    >
    >
    =?Utf-8?B?TmlnZ3k=?=, Jul 26, 2005
    #3
  4. =?Utf-8?B?TmlnZ3k=?=

    Brock Allen Guest

    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_SelectedIndexChanged(Object
    >>> sender, EventArgs e) in
    >>> c:\inetpub\wwwroot\WebApplication1\WebForm4.aspx.vb:line 150
    >>>
    Brock Allen, Jul 27, 2005
    #4
  5. 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_SelectedIndexChanged(Object sender,
    > EventArgs e) in c:\inetpub\wwwroot\WebApplication1\WebForm4.aspx.vb:line 150
    =?Utf-8?B?Q2hyaXM=?=, Jul 27, 2005
    #5
  6. 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_SelectedIndexChanged(Object sender,
    > > EventArgs e) in c:\inetpub\wwwroot\WebApplication1\WebForm4.aspx.vb:line 150
    =?Utf-8?B?TmlnZ3k=?=, Jul 27, 2005
    #6
  7. =?Utf-8?B?TmlnZ3k=?=

    Chris Hayes Guest

    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" <> wrote in message
    news:...
    >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_SelectedIndexChanged(Object
    >> > sender,
    >> > EventArgs e) in
    >> > c:\inetpub\wwwroot\WebApplication1\WebForm4.aspx.vb:line 150
    Chris Hayes, Jul 28, 2005
    #7
  8. 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" <> wrote in message
    > news:...
    > >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_SelectedIndexChanged(Object
    > >> > sender,
    > >> > EventArgs e) in
    > >> > c:\inetpub\wwwroot\WebApplication1\WebForm4.aspx.vb:line 150

    >
    >
    >
    =?Utf-8?B?TmlnZ3k=?=, Jul 28, 2005
    #8
  9. =?Utf-8?B?TmlnZ3k=?=

    Chris Hayes Guest

    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" <> wrote in message
    news:...
    >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" <> wrote in message
    >> news:...
    >> >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_SelectedIndexChanged(Object
    >> >> > sender,
    >> >> > EventArgs e) in
    >> >> > c:\inetpub\wwwroot\WebApplication1\WebForm4.aspx.vb:line 150

    >>
    >>
    >>
    Chris Hayes, Jul 29, 2005
    #9
  10. 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...
    =?Utf-8?B?QnJ5YW4gV2Fnc3RhZmY=?=, Jul 29, 2005
    #10
  11. 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_SelectedIndexChanged(Object sender,
    > EventArgs e) in c:\inetpub\wwwroot\WebApplication1\WebForm4.aspx.vb:line 150
    =?Utf-8?B?Q2FwdGFpbg==?=, Sep 16, 2005
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Poppy

    Response.redirect not working

    Poppy, Nov 3, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    4,512
    Peter O'Reilly
    Nov 3, 2003
  2. =?Utf-8?B?VHJveQ==?=

    Response.redirect does not redirect from .aspx page

    =?Utf-8?B?VHJveQ==?=, Oct 18, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    5,221
    Srowe1975
    Oct 15, 2008
  3. =?Utf-8?B?UmF2aW5kcmE=?=

    Why Response.Redirect is not working in Session_End event?

    =?Utf-8?B?UmF2aW5kcmE=?=, Nov 25, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    7,372
    Jeffrey Palermo [MCP]
    Nov 25, 2004
  4. gaurav tyagi
    Replies:
    14
    Views:
    1,306
    gaurav tyagi
    Jan 20, 2006
  5. Sal
    Replies:
    1
    Views:
    381
Loading...

Share This Page