如何停止ModalPopupExtender显示 [英] How can ModalPopupExtender be stopped to show

查看:71
本文介绍了如何停止ModalPopupExtender显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ModalPopupExtender,它在打印报告时显示正在进行的工作的图像.
在用户单击以显示rpeort按钮之前,我必须接受一些用户输入.
验证扩展器用于输入验证.

I have a ModalPopupExtender where I show a image of work in progress while printing a report.
I have to take some user input before the user click to show rpeort button.
A validation extender is used for the input validation.

How can I stop the popuop extender to show if the input is not valid?

推荐答案

hi
您可能想尝试此示例..

hi
you may like to try this example..

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
 <asp:ScriptManager runat="server" ID="script1"></asp:ScriptManager>
 <script type="text/javascript">
     function showModalPopup() {
         if (document.getElementById("<%=TextBox2.ClientID %>").value == "") {
             alert("No of copies should not be blank");


find('popup1',null).hide(); } else {
find('popup1', null).hide(); } else {


find('popup1',null).show(); } } < /script > < asp:Panel ID =" runat 服务器" < asp:Label ID =" runat 服务器" 文本 准备打印" < /asp:标签 > < asp:Button ID =" runat 服务器" =" > < asp:Button ID =" runat 服务器" =" > < /asp:Panel > < asp:Label ID =" runat 服务器" 文本 输入副本数" < /asp:标签 > < asp:TextBox ID =" runat 服务器" ValidationGroup 测试" < /asp:TextBox > < 输入 =" 按钮" id Button3" runat =" 服务器" onclick showModalPopup();" 提交" > < asp:ModalPopupExtender ID =" runat 服务器" 行为ID =" DynamicServicePath =" " 已启用 =" TargetControlID =" PopupControlID =" CancelControlID Button4" OkControlID =" > < /asp:ModalPopupExtender > < asp:RequiredFieldValidator ID =" Runat 服务器" ValidationGroup 测试" ErrorMessage =" ControlToValidate TextBox2" < /asp:RequiredFieldValidator > <!- 最后保留此控件以将其隐藏 -> < asp:Button ID =" runat 服务器" =" =" 测试" 样式 =" / < /asp:Content >
find('popup1', null).show(); } } </script> <asp:Panel ID="Panel1" runat="server"> <asp:Label ID="Label1" runat="server" Text="Ready To Print"></asp:Label> <asp:Button ID="Button1" runat="server" Text="Start Printing" /> <asp:Button ID="Button4" runat="server" Text="Cancel" /> </asp:Panel> <asp:Label ID="Label2" runat="server" Text="Enter No of Copies"></asp:Label> <asp:TextBox ID="TextBox2" runat="server" ValidationGroup="Test"></asp:TextBox> <input type="button" id="Button3" runat="server" onclick="showModalPopup();" value="Submit" /> <asp:ModalPopupExtender ID="Button2_ModalPopupExtender" runat="server" BehaviorID="popup1" DynamicServicePath="" Enabled="True" TargetControlID="Button2" PopupControlID="Panel1" CancelControlID="Button4" OkControlID="Button1" > </asp:ModalPopupExtender> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" Runat="server" ValidationGroup="Test" ErrorMessage="TextBox2 should not be blank" ControlToValidate="TextBox2"></asp:RequiredFieldValidator> <!-- Keep this control at the last to hide it --> <asp:Button ID="Button2" runat="server" Text="" ValidationGroup="Test" style="margin-left:-15000px" /> </asp:Content>


这篇关于如何停止ModalPopupExtender显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆