How to control ModalPopupExtender after AsyncPostBackError

ⅰ亾dé卋堺 提交于 2019-12-08 00:44:47

问题


I have a pretty simple question which I'm sure somebody has come across before.

I am using an AJAX ModalPopupExtender to initiate an Ajax request.

In the event of an error I want to raise an alert and hide the Ajax ModalPopupExtender. My attempts of hiding the ModalPopup extender and displaying the exception as an alert have been unsuccessful after an exception is raised.

It seems that the show()/hide() methods of the ModalPopupExtender are disabled when there is an unhandled exception.

My first attempt was to try and hide the ModalPopupExtender by adding exception handling into the calling method, calling hide() on the ModalPopupExtender and then re-throwing the exception so that the execption is caught and displayed as an alert to the user. This didn't work.

My second attempt was to call hide() on the ModalPopupExtender within the AsyncPostBackError event of the ASP.NET Ajax scriptmanger control. This didn't work either.

Any ideas for a solution to this problem?

来源:https://stackoverflow.com/questions/1095686/how-to-control-modalpopupextender-after-asyncpostbackerror

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!