Response.Redirect after exception being throw during AJAX call

5 posts, 1 answers
  1. LamKhoa
    LamKhoa avatar
    92 posts
    Member since:
    Jun 2011

    Posted 21 Sep 2013 Link to this post

    Hi All,

    Whenever an exception error is thrown, the Application_Error (in Global.ascx) is fired, but neither Response.Redirect or Server.Transfer works.

    I tried the same thing with Page_Error (on individual page), it works.

    Is there any workaround to make it works in Application_Error like it is in Page_Error?

    Thanks All.
  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 25 Sep 2013 Link to this post

    Hello,

    If you're looking for Error Management, you're better off using Server.GetLastError() so you get the full Exception object including stack trace.

    Here's an MSDN article that deals with Application Errors in general and uses Server.GetLastError().


    Regards,
    Maria Ilieva
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. LamKhoa
    LamKhoa avatar
    92 posts
    Member since:
    Jun 2011

    Posted 25 Sep 2013 Link to this post

    Yes, I know about that and I have set so that an email will be automatically be sent to me about that Exception error. However, I still can't get the page to be transfer, I don't like the fact that user stuck in the broken page and don't know why it is not responding no more.

    Thanks

    Lamk
  5. Answer
    Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 30 Sep 2013 Link to this post

    Hi LamKhoa,

    After further revising the ticket and noticed the additional info in the ticket title I would conclude that the issue is actually causing by the fact you are using Ajax requests to the server instead of regular postback. Note that the required functionality could not be achieved when Ajax is used. Therefore please disable the ajax on the page and verify how it goes.

    Regards,
    Maria Ilieva
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  6. LamKhoa
    LamKhoa avatar
    92 posts
    Member since:
    Jun 2011

    Posted 30 Sep 2013 Link to this post

    Thanks. If so, I rather stick to use Page_Error event on each individual page.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017