I am converting an existing ASP.NET website to use jQuery Mobile controls. The first thing I did was replace the Login.aspx with the new Masterpage and mobile controls. However, now after the login occurs, in the code-behind, there is a Response.Redirect to Default.aspx. When that occurs, a javascript error occurs and the whole page dumps and fails to load.
My assumption is that the mechnanism(s) in jQuery mobile that try to AJAX everything are not playing nicely with scripts that MS.NET is producing. So I want jQuery to ignore the redirect and not AJAXify it.
The problem is, all the solutions I see have to do with adding code to the anchor tag, but I'm redirecting from behind, not using an anchor tag.
Add the attribute data-ajax="false"
to the <form>
tag on the page. That way when the login form is submitted, jQuery Mobile won't try to update the page using AJAX.
If you are using jQuery mobile then you can use following code to disable ajax through the page.
<script>
$.mobile.ajaxEnabled = false;
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With