DreamTeK
DreamTeK

Reputation: 34177

Disable Jquery Mobile Ajax Navigation

Despite endless reading of the API documentation and internet post I cannot get the AJAX Navigation to be disabled.

CURRENT SCRIPTS

<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.0-alpha.2/jquery.mobile-1.4.0-alpha.2.min.js"></script>
<script>
$(document).bind(“mobileinit”, function() { 
    $.mobile.ajaxEnabled = false; 
});
</script>

MY ISSUE

Using ASP.NET Forms When I login from a root page (index.aspx) I should be redirected to a folder (LOGIN) where the rest of my site is but the folder is not passed to URL.

I GET /Page.aspx

Instead of /LOGIN/Page.aspx

QUESTION

How to fix the navigation behavior for ASP.NET forms Login Submit OR

How to disable AJAX Navigation globally for Jquery Mobile 1.4

Upvotes: 0

Views: 1611

Answers (2)

Sam Plus Plus
Sam Plus Plus

Reputation: 4591

I know this is older, but having just dealt with this. If you want to disable Ajax Navigation globally add the following script AFTER Jquery, but BEFORE Jquery mobile. Order is very important here.

The code would look something like:

<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script>
$(document).on("mobileinit", function () {
  $.extend($.mobile, {
    ajaxEnabled: false
  });
});
</script>
<script src="http://code.jquery.com/mobile/1.4.0-alpha.2/jquery.mobile-1.4.0-alpha.2.min.js"></script>

see http://demos.jquerymobile.com/1.0a3/#docs/api/globalconfig.html

Upvotes: 2

DreamTeK
DreamTeK

Reputation: 34177

I found a simple solution as below:

just add to your master form:

data-ajax="false"

<form runat="server" data-ajax="false">

This will disable ajax navigation on the selected form.

As this is ASP.NET adding it to the sites master form will disable AJAX form submit behavior site wide.

This way you do not need to use the script as mentioned above.

Upvotes: 2

Related Questions