I used the way given in this article.
This works fine when I did the same steps in a new ASP.NET application.
But when I repeat the same steps in the application on which i am working it give the error:"PageMethods is Undefined".
I am working on .Net 4.0.
Have you enabled page methods on your scriptmanager?
<asp:ScriptManager ID="ScriptManager1"
EnablePageMethods="true"
runat="server" />
Make sure you have a ScriptManager control?
As an alternative to trying to get the PageMethods approach to work, I would recommend switching to the more up to date WCF Script Services:
- Exposing WCF Services to Client Script
- Forget Page Methods move on to Script Services
精彩评论