0

I am on a view where the user modifies the page where the url is as follows:

    http://localhost:45217/DView/EditResultsDetail?locId=3397&paramId=1375&Date=02%2F11%2F2013%2014%3A44%3A47

When the user clicks on Submit, I do a POST. I do a RedirectToAction follows:

     return RedirectToAction("ResultsDetail", new { locId = locId, dt = date });

This works in that the ResultsDetail action is called and corret view is displayed.

The problem though is the the querystring still remains:

                http://localhost:45217/DView/EditResultsDetail?locId=3397&paramId=1375&Date=02%2F11%2F2013%2014%3A44%3A47

The problem with this is that if the user clicks on Refresh, they will go back to the EditResultsDetail action and not remain on ResultsDetail.

2
  • 1
    That would not happen. A RedirectToAction sends a redirect code back to the browser, so it would do a full redirect to your new URL. The only time I'd expect to see this problem is if you were inside of an iframe. Make sure that RedirectToAction code is actually happening, and keep an eye on the HTTP calls in Fiddler or your browser's network tab. Commented Jul 5, 2013 at 17:52
  • Thanks Joe. I am using this with Jquery Mobile so not sure if this may an issue. Commented Jul 5, 2013 at 17:56

1 Answer 1

1

Looks like your form submission is not doing a full post, but rather an AJAX call. jQueryMobile is probably doing that automatically for you.

I believe putting data-ajax="false" inside your form tag will prevent the AJAX call and do a full post instead. This will take away some of the niceness of jQueryMobile's user experience, but it should get you what you're asking for.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.