弹出面板,回发问题
本文关键字:问题 | 更新日期: 2023-09-27 18:06:57
我有一个面板作为弹出
<asp:Panel ID="CreateGroupPanel" runat="server" BackImageUrl="~/Light-Gray-Suede1.jpg"
CssClass="style10" Visible="True"
style="position: absolute; left: 214px; top: 1262px; width: 588px; height: 467px">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label3" runat="server" CssClass="style11" Text="Group Name*"
style="position: absolute; left: 63px; top: 92px; width: 88px; height: 19px; background-image: url('Light-Gray-Suede1.jpg')"></asp:Label>
<asp:Label ID="Label4" runat="server" CssClass="style12" Text="Members*"
style="position: absolute; left: 67px; top: 278px; width: 66px; height: 19px; background-image: url('Light-Gray-Suede1.jpg')"></asp:Label>
<asp:Label ID="Label5" runat="server" CssClass="style9"
Text="Groups | + Create group"
style="background-image: url('Light-Gray-Suede1.jpg')"></asp:Label>
<asp:Label ID="Label6" runat="server" CssClass="style13"
style="background-image: url('Light-Gray-Suede1.jpg'); position: absolute; left: 63px; top: 130px; width: 80px; height: 19px;"
Text="Add user(s)*"></asp:Label>
<asp:TextBox ID="GroupName" runat="server" CssClass="style109"
style="position: absolute; left: 170px; top: 91px; width: 135px; height: 22px"></asp:TextBox>
<asp:Button ID="Create" runat="server" CssClass="style106"
onclick="Create_Click"
style="background-image: url('Light-Gray-Suede1.jpg')"
Text="Create Group" />
<asp:Button ID="Cancel" runat="server" CssClass="style107" Text="Cancel"
onclick="Cancel_Click"
style="background-image: url('Light-Gray-Suede1.jpg')" />
<asp:Button ID="Add" runat="server" CssClass="style108" OnClientClick="Add_Click"
style="background-image: url('Light-Gray-Suede1.jpg')"
Text="Add" />
<asp:ListBox ID="ListBoxMembers" runat="server" CssClass="style105"></asp:ListBox>
<asp:ListBox ID="ListBoxREmoved" runat="server" CssClass="style104"></asp:ListBox>
<asp:Button ID="Button1" runat="server" CssClass="style103"
onclick="Button1_Click" Text="Remove>>" />
<asp:Listbox ID="ListBoxAddMembers" runat="server" CssClass="style102"
DataSourceID="SurelyKnown" DataTextField="FirstName" DataValueField="FirstName"></asp:ListBox>
<asp:SqlDataSource ID="SurelyKnown" runat="server"
ConnectionString="<%$ ConnectionStrings:surelyknownConnectionString %>"
ProviderName="<%$ ConnectionStrings:surelyknownConnectionString.ProviderName %>"
SelectCommand="SELECT FirstName FROM tbl_user"></asp:SqlDataSource>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
当我单击面板内的添加按钮以从列表框添加值到文本框时,面板因添加按钮单击而返回,并且弹出窗口因此关闭。(但当我再次点击按钮打开弹出添加方法执行和值被添加)如何从列表框添加值到文本框没有弹出被关闭
尝试为更新面板设置ChildrenAsTrigger="false"
并指定显式触发器。
如果你还没有,我会把面板和ModalPopupExtender(假设你使用AJAX工具包)在一个UpdatePanel,并作为Bala R建议尝试设置ChildrenAsTrigger为false。
使用更新面板,即使按钮单击事件仍然导致弹出窗口关闭,您可以在按钮单击事件中重新打开它,并且它对用户来说将是无缝的,因为这一切都是通过Ajax完成的。