从位于更新面板内部的 ASP.NET 按钮调用 Javascript
我正在使用 JQuery 来切换 Web 表单应用程序中的可见性。我正在使用更新面板来抑制单击我的回发。单击此按钮时我想做的是调用 JQuery 代码,我用它来在回发完成后切换。我需要实现什么代码(客户端或服务器端)?感谢您。
编辑:
我不仅需要在回发完成时触发切换事件,而且还需要在服务器端代码表明用户的输入有效时触发切换事件。
I am using JQuery to toggle the visibility of a in a webforms application. I am using an update panel to suppress the postback when my is clicked. What I would like to do when this is clicked is call the JQuery code that I use to toggle the once the postback has completed. What code(client-side or server-side) do I need to implement? Thanks you.
Edit:
I don't just need to fire the toggle event when the postback has completed, but when server-side code says that the user's input is valid.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在服务器端尝试此操作:
这将在回发完成时调用您的函数
you can try this on server side:
this will call your function when the postback completes
当然:
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
这是一个 JavaScRipt 回调。只需插入处理程序即可切换代码
Sure:
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
This is a JavaScRipt callback. Just plug you handler in to toggle your code