Page Method Not working

Posted by Emil under ASP.NET AJAX on 2/28/2012 | Points: 10 | Views : 3841 | Status : [Member] | Replies : 2
In my login page there is option for forgot password.
Forgot Password has field userid on change of the textbox of user id i need to check whether the user id is present in table or not.
For this i am using pagemethods.
But when i tried to call the C# method in login.aspx.cs with pagemethods.
i am getting the exception

System.InvalidOperationException-- Authentication failed.

Any one had a solution please share.




Responses

Posted by: Ppathi on: 2/28/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,

Refer this link, hope it will help

http://www.dotnetfunda.com/forums/thread2401-calling-a-page-method-in-javascript.aspx

Thanks & Regards,
Pasupathi G
No Pain No Gain

Emil, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Pradeepkumar417 on: 2/28/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,

You have add the ScriptManager control and set the EnablePageMethods property as true and also set the attribute to the pagemethod like below

[System.Web.Services.WebMethod()]

public static string MyFirstPageMethod()
{
return "Welcome to the world of AJAX.NET " ;
}


and go through this below link

http://weblogs.asp.net/sohailsayed/archive/2008/02/23/calling-methods-in-a-codebehind-function-pagemethods-from-client-side-using-ajax-net.aspx

Thanks & Regards,
Software Engineer,
Pradeep Kumar

Emil, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response