0

I have a form on my index view that is posting to my submit action like this

  @using(Html.BeginForm("Submit","Receiving", FormMethod.Post))
   {
       ....
    }

In that action I am returning a RedirectToAction after all the work that is needed is done

   public ActionResult Submit(string selectedSerialNumber, string aisle, string rack, string rackbin)
    {

        //do the work

        return RedirectToAction("Index");
    }

after the user submits the form the Url shows "/Receiving/Submit" with the view of the index

instead of "/Receiving" or "/Receiving/Index"

If the user refreshes the page it tries to go back to the submit action again which is not what is expected and causing problems. they are expecting to refresh the index page how can I get that Url to go back to the index action after it is redirected. Thanks!

twaldron
  • 2,722
  • 7
  • 40
  • 55
  • 1
    Are you sure that the return statement is reached? Have you set a breakpoint to verify it? – strmstn Oct 10 '12 at 21:25
  • Seems odd. I haven't seen this behavior before. What version of MVC? Is there anything happening in "// do the work" that would cause it to skip the RedirectToAction? – Sam Oct 10 '12 at 21:26
  • I thought is was super odd as well as I have been doing MVC since it came out. I am on MVC3. I have verified that it is reaching the return and statement with no exceptions thrown and not skipping it. I have verified that it is going to the Index action and returning the correct view. the url is just still showing /Submit – twaldron Oct 10 '12 at 21:33
  • @twaldron `RedirectToAction` is 302 HTTP code with url, check response with fiddler. – webdeveloper Oct 10 '12 at 21:35

1 Answers1

0

Jquery mobile is the cause I found this question after i realized the only difference with this site is jquery mob

Community
  • 1
  • 1
twaldron
  • 2,722
  • 7
  • 40
  • 55