Hi
im getting the error
Microsoft JScript runtime error: 'PageMethods' is undefined
here is my cide
[WebMethod] public static bool CheckAvailability(string uid) { MembershipUser user = Membership.GetUser(uid); if (user == null) { return true; } else { return false; } }
and here is javascrript
<script type="text/javascript"> function CheckAvailability() { var uid = $("#username").val(); if (uid == "") { alert('Please enter user ID!'); return false; } PageMethods.CheckAvailability(uid, OnComplete); return false; } function OnComplete(result) { var lblmsg = $("#lblmsg").val(); if (result) { lblmsg.innerText = "The ID is available!"; } else { lblmsg.innerText = "The ID is unavailable!"; } }</script>
I have script manage in master page file
<asp:ScriptManager ID="ScriptManager2" runat="server" EnablePageMethods="true" EnablePartialRendering="true" ></asp:ScriptManager>
I dont know if i have called javascript in wrong place on content page,
but simple alert message is working on that script
here in case alert('Please enter user ID!');
Any help would be appreciated!!!
Thanks