Author: OneMHz | Posted on: 9/11/2007 12:58:49 PM | Views : 267

I have a method in my codebehind that I would like to call from javascript.  My script manager tag has EnablePageMethods="true" and the method in my codebehind is tagged with [WebMethod] and [ScriptMethod].  When I trigger the javascript, I get errors.  I've found some things that say that if you want to call a server side method (not in a web service) from your javascript with the PageMethods collection, you have to have that in a script block in your aspx.  I've created a script block with a method in my aspx that just calls the function in my codebehind, but I think that's kind of ugly.  Is there something I might have just missed that would allow me to just call my codebehind?
Thanks 
...

Go to the complete details ...