I have an asp.net web application that I provide to mobile devices. Im uses jQuery and jqMobile for functionality and style.
The application works fine in safari, Google Chrome, on iPhone, iPad and Android devices, but I canโt get it to work for anything other than the Blackberry torch. I have a requirement to make it work on BlackBerry devices versions 5 and 6, but it seems like the ajax login request always calls an error function, and I cannot understand why.

The application contains several pages, but I canโt even go through the Blackberry login page. Has anyone else been able to receive ajax calls running on a blackberry? I really don't want to have a separate set of pages for Blackberrys only.
Here is the code for aspx login page
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="Sicon.Web.WAP.App.Pages.Mobile.Login" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title></title> <link href="../../JavaScripts/jquery.mobile.min.css" rel="stylesheet" type="text/css" /> <script src="../../JavaScripts/jquery.min.js" type="text/javascript"></script> <script src="../../JavaScripts/jquery.mobile.min.js" type="text/javascript"></script> </head> <body> <form id="login" runat="server" accept-charset="utf-8"> <div id="Invoices" data-role="page" data-theme="b"> <div data-role="header" data-theme="b"> <h1> WAP - Login</h1> </div> <div data-role="content" data-theme="b"> <div align="center"> <img src="Sicon_LogoHz_rgb72.png" /> </div> <ul data-role="listview" data-inset="true"> <li> <input type="text" value="" name="username" placeholder="Username" id="username" /> </li> <li> <input type="password" value="" name="password" placeholder="Password" id="password" /> </li> </ul> <a class="login" data-role="button" data-theme="b">Login</a> <a data-role="button" data-theme="a">Cancel</a> </div> </div> </form> <script type="text/javascript"> var _ajaxEnabled = true; $(document).ready(function() { _ajaxEnabled = $.support.ajax; }); </script> </body> </html>
And finally, the code for the login method:
/// <summary> /// Logs in the user /// </summary> /// <param name="Username">The username</param> /// <param name="Password">The password</param> /// <returns></returns> [WebMethod, ScriptMethod] public static bool LoginUser( string Username, string Password ) { try { StaticStore.CurrentUser = new User( Username, Password ); //check the login details were correct if ( StaticStore.CurrentUser.IsAuthentiacted ) { //change the status to logged in StaticStore.CurrentUser.LoginStatus = Objects.Enums.LoginStatus.LoggedIn; //Store the user ID in the list of active users ( HttpContext.Current.Application[ SessionKeys.ActiveUsers ] as Dictionary<string, int> )[ HttpContext.Current.Session.SessionID ] = StaticStore.CurrentUser.UserID; return true; } else { return false; } } catch ( Exception ex ) { return false; } }
Wraithnath
source share