Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery mobile not updating URL properly on MVC4 RedirectToAction
    primarykey
    data
    text
    <p>I am having a problem with jquery mobile not updating the URL on an MVC4 RedirectToAction call from a controller. I've read other similar questions that have multiple resolutions, but none have worked for me. I want the jquery mobile loading messages to appear between pages, so I cannot use $.mobile.ajaxEnabled = false as a solution.</p> <p>Start URL : </p> <pre><code>//localhost/Application/Demo/Views/FirstPageController/ </code></pre> <p>If I leave my code as is (below), it will show this same URL when it should be showing this URL:</p> <pre><code>//localhost/Application/Demo/Views/SecondPageController/Edit </code></pre> <p>I've tried using TempData to hold a dataurl from within the controller, but it just ends up appending the dataurl onto the above URL. </p> <p>For example,</p> <pre><code>//localhost/Application/Demo/Views/FirstPageController/ </code></pre> <p>will show up as</p> <pre><code>//localhost/Application/Demo/Views/FirstPageController/#Application/Demo/Views/SecondPageController/Edit </code></pre> <p>instead of</p> <pre><code>//localhost/Application/Demo/Views/SecondPageController/Edit </code></pre> <p>How do I get it to display the proper url for the next page?</p> <p>Controller:</p> <pre><code> [HttpPost] public ActionResult Index(FirstPageViewModel viewModel) { return RedirectToAction("Edit", "SecondPageController"); } </code></pre> <p>Layout.js (runs globally for all pages)</p> <pre><code>$(document).on("mobileinit", function () { $.mobile.loader.prototype.options.text = "Loading..."; $.mobile.loader.prototype.options.textVisible = true; $.mobile.loader.prototype.options.theme = "b"; $.mobile.loader.prototype.options.html = ""; $.ajaxSetup({ beforeSend: function (x, y) { showProgress(); }, complete: function (x, y) { hideProgress(); } }); }) function showProgress(element) { if (element == undefined) { $("#FormSubmit").find("input").addClass("ui-disabled"); $("#FormSubmit").find("select").addClass("ui-disabled"); $("#FormSubmit").find("button").addClass("ui-disabled"); $.mobile.loading('show'); } else { $(element).addClass("ui-disabled"); $.mobile.loading('show'); } } function hideProgress(element) { if (element == undefined) { $("#FormSubmit").find("input").removeClass("ui-disabled"); $("#FormSubmit").find("select").removeClass("ui-disabled"); $("#FormSubmit").find("button").removeClass("ui-disabled"); $.mobile.loading('hide'); } else { $(element).removeClass("ui-disabled"); $.mobile.loading('hide'); } } </code></pre> <p>Button (from the first razor page)</p> <pre><code>&lt;input type="submit" data-icon="arrow-r" data-mini="true" data-iconpos="right" name="Continuebutton" value="Continue" /&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload