在 ASP.Net 中,我可以使用 Javascript 和 PageMethods 调用用户控件 WebMethod 吗?

发布于 2024-07-22 02:25:39 字数 26 浏览 4 评论 0原文

它说 PageMethods 未定义。

It's saying PageMethods is undefined.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

源来凯始玺欢你 2024-07-29 02:25:39

是的。 你绝对可以。 只需确保 WebMethod 已声明为 public static,您已使用正确的命名空间引用它,并且 ScriptManagerEnablePageMethods 属性为设置为true

Yes. You definitely can. Just make sure that the WebMethod has been declared as public static, you have referred it using the proper namespace, and EnablePageMethods property of the ScriptManager is set to true.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文