EDITED
Hi, I am using masterpage. And I use formauthentication in my project. I retrieve data from SQL Server 2005. Then in login.aspx I call my pagemethod from jQuery. In the end, I run my project in IE9.0, Chrome and Firefox. The project is correct. But this jQuery code only works with IE9.0.
My pagemethod called LoginService returns β0β or returnURL as βuser / Default.aspxβ, then I control this tah, if the LoginService return is not β0β successful, the following will be executed:
alert("there isnt error: " + msg.d);
but if there is an error, this will start:
alert("there is error: " + msg.d);
It is very interesting that
if I run this project in IE9, the message is shown as "there is not error: user / Default.aspx"
but
if I run this project in Chrome or Firefox, the message is shown as "there is an error: undefined"
How can I run this project in all browsers?
<script type="text/javascript"> jQuery(document).ready(function () { jQuery("#myContent_login").focus(); jQuery("#myContent_submit_image").click(function () { jQuery("#login_form_spinner").show(); jQuery.ajax({ type: "POST", url: "Logon.aspx/LoginService", data: "{'username': '" + jQuery("#myContent_login").val() + "', 'password': '" + jQuery("#myContent_password").val() + "','isRemember': '" + jQuery("#myContent_remember_me").is(':checked') + "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { if (msg.d != 0) { alert("there isnt error: " + msg.d); } }, error: function (msg) { alert("have error: " + msg.d); } }); }); }); </script>
jquery cross-browser firefox google-chrome asp.net-ajax
Emre ORDUKAYA
source share