使用 AJAX 的 ASP.NET 3.5 中的消息框
我有一个带有 AJAX 更新面板的 ASP.NET 3.5 网站。我只需要处理一些服务器端代码,然后发出用户提示“代码处理完成”。
我知道 ASP.NET 中应该支持 Msgbox 式的方法,但我找不到它们,并且当您有更新面板时,任何其他基于 JavaScript 的解决方案都无法有效工作。
帮助。
I have a ASP.NET 3.5 web site with an AJAX update panel. I simply need to process some server side code and then issue a user prompt that says "Code processing complete".
I know there is supposed to be support for Msgbox-esque methods in ASP.NET but I can't find them and any other JavaScript based solutions don't work effectively when you have an update panel.
Help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
找不到这方面的直接示例,因此您可以了解如何使用它,并根据您的需要进行更改。在客户端,有一个 get_isInAsyncPostback() 方法来检查 updatepanel 是否将执行异步回发。
此链接向您展示如何取消更新:http://www.aspx.aspx asp.net/ajax/documentation/live/Tutorials/CancelAsyncPostback.aspx
使用这里的主题,而不是 beginRequest,您可以点击 endRequest 事件,如果是异步回发,您可以在此处发布警报。这假设代码成功运行,您要添加哪些检测?
HTH。
Couldn't find a direct example for this, so you can see how this is being used, and change it for your needs. On the client, there is a get_isInAsyncPostback() method to check if an updatepanel will be performing an async postback.
This link shows you how to cancel an update: http://www.asp.net/ajax/documentation/live/Tutorials/CancelAsyncPostback.aspx
Using the themes in this, instead of the beginRequest, you can tap into the endRequest event, and if an async postback, you can post an alert here. This assumes that the code works successfully, which are you adding that detection?
HTH.
MsgBox 不存在,但看看 javascriptalert() 函数。这将为您弹出消息。
从
如果您想 服务器端代码,您可以使用:
MsgBox doesn't exist, but look at the javascript alert() function. That'll popup the message for you.
here is a link with more information on javascript popups
If you want to inject javascript from the server-side code, you can use this: