ajaxFormsEnabled = false / caching?

ajaxFormsEnabled = false / caching?

Please excuse my ignorance on this but I am tired of fighting this.  I need to do a file upload on one of my JQuery Mobile pages.  I'm doing this in .NET MVC 3, just for the record.

I have four pages, A, B, C, and D.  A, B, and D gather info and/or save stuff.  Page C does the upload.

I know that I need to disable ajaxForms in order to accomplish the upload.  So below is how I have my javascript stuff setup in the <head> for each page.

PAGE A

  1. <script src="http://code.jquery.com/jquery-1.5.min.js"></script>
  2. <script src="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js"></script>

PAGE B

same as above

PAGE C

  1. <script src="http://code.jquery.com/jquery-1.5.min.js"></script>
  2. <script type="text/javascript" src="../../../../Scripts/my-noajax.js"></script>
  3. <script src="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js"></script>

where my-noajax.js contains the following:

  1. $(document).bind("mobileinit", function () {
  2.     //apply overrides here
  3.     $.mobile.ajaxLinksEnabled = false;
  4.     $.mobile.ajaxFormsEnabled = false;
  5. });

PAGE D

same as A and B

If I navigate normally into the site through pages A, then B, and then C it caches the <head> declarations from A and carries them to C.  So the my-noajax.js doesn't happen.

If I enter the site directly to page C all is good.

What can I do to keep this from happening?

Thanks!

Steve