PageMethods is not defined

后端 未结 3 475
不知归路
不知归路 2021-01-14 00:11

I am setting up PageMethods to access server side code using javascript. I am receiving the error \"PageMethods is not defined\" when i debug using firebug. the server side

3条回答
  •  醉酒成梦
    2021-01-14 00:46

    Page Methods don't work in either Master Pages or User Controls.

    If you move the method up one level to you page it should work.

    Never really been able to get a definitive answer on this one.

    I suspect it has do with the fact that aspx pages inherit from the Page class and the ascx controls inherit from the UserControl class. As to why of that I am not too sure.

    Personally I would use a generic handler (.ashx) page and call that through javascript.

提交回复
热议问题