开发者

How to ensure ModalPopupExtender only shows when validation is successful?

开发者 https://www.devze.com 2022-12-23 00:59 出处:网络
How do I setup the ModalPopupExtender to not show when the validation on the page fails? I have a Re开发者_运维技巧quiredFieldValidator on a textbox. On Submit, I would like to show the ModalPopupExte

How do I setup the ModalPopupExtender to not show when the validation on the page fails? I have a Re开发者_运维技巧quiredFieldValidator on a textbox. On Submit, I would like to show the ModalPopupExtender ONLY if validation is successful.


I set it up so that I can control it on the server side. This way, I was able to run the validation first before showing/hiding the ModalPopupExtender


It should be fairly straightforward. In your Page_Load or PreRender code, try something like this:

if (Page.IsValid)
{
   myModalExtender.Show();
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号