开发者

How to ensure ModalPopupExtender only shows when validation is successful?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜