function AuthUsr() {
(function ($) {
var obj = {};
obj.Usrname = $.trim($("#username").val());
obj.Pw = $.trim($("#password").val());$.ajax({
type: "POST",
url: "../../SessionService.asmx/AuthUsrEntry",
data: JSON.stringify(obj),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (r) {
var serresp = r.d
return run(serresp)
}
});
})(jQuery);}
function run(e) {
if (e == false) {
alert(e)
MsgNotify('Error', '', 'Invalid Password!', '', '')
return false;
}
else {
//$('#login').submit();
return true;
__doPostBack('#cmdlogin', '')
};};
<asp:Button ID="cmdlogin" runat="server" Text="Sign in" OnClick="cmdlogin_Click"CssClass=" pushed button btn-blue" ClientIDMode="Static" OnClientClick="return AuthUsr();" Style="display: block; margin-right: auto; margin-left: auto"UseSubmitBehavior="False" />I m posting my code and HTML build for the button, I tried postback, submit and other functions,, none worked. I m running the my elements in update panel
I know my problem is in returning and employing the boolean val from AJAX call
Please help