locked
Redirect after Ajax upload RRS feed

  • Question

  • User1526116210 posted

    I have finally managed to implement JQuery Ajax upload on my ASP.NET web pages site but now I would like to know how to redirect to a page with the id of what was uploaded, if I put the redirect in my upload handler it doesn't work. Does anyone have any idea how to use Response.Redirect(); after an Ajax upload?

    I would prefer not to use JavaScript to perform my redirect.

    Tuesday, July 30, 2013 4:02 AM

Answers

  • User-664094036 posted

    Register for UploadedComplete (ajax success on clientside) event and Redirect from their.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 30, 2013 4:07 AM

All replies

  • User-664094036 posted

    Register for UploadedComplete (ajax success on clientside) event and Redirect from their.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 30, 2013 4:07 AM
  • User1526116210 posted

    Um what? ASP.NET web pages has no codebehind

    Tuesday, July 30, 2013 4:14 AM
  • User1526116210 posted

    I would prefer not to use JavaScript to perform my redirect because my redirect uses the id of last db insert

    Response.Redirect("~/Game/" + db.GetLastInsertId());



    Tuesday, July 30, 2013 4:55 AM
  • User-821857111 posted

    If you want to redirect the user to another page after the post, there seems little point in using AJAX to do the upload. 

    Tuesday, July 30, 2013 6:31 AM
  • User1526116210 posted

    The only reason I want it is to show the upload progress but I now think my only option fro redirect is through JavaScript upon receiving complete as dhavalu said. I decided to get the last db insert by having it as the AJAX response and then using that response in

    window.location = '/Game/' + xhr.responseText.trim();

    Which seems to work fine

    Tuesday, July 30, 2013 6:42 AM