我有一个模态弹出扩展器。在面板内,我有两个占位符。两者都是可见的错误。当我按下按钮并
this.ModalPopupExtender1.Show();
PlaceHolder1.Visible = true;
PlaceHolder2.Visible = false;
打开模态弹出窗口之类的代码时。当我有这样的代码时:
this.ModalPopupExtender1.Show();
PlaceHolder1.Visible = false;
PlaceHolder2.Visible = true;
模式弹出窗口未打开。如何解决这个问题?我附上我的 asp.net 代码:
<asp:Button ID="btnShowPopup" runat="server" style="display:none" />
<asp:ModalPopupExtender
ID="ModalPopupExtender1" runat="server" PopupControlID="pnlpopup"
TargetControlID="btnShowPopup" CancelControlID="btnCancel"
OkControlID="btnUpdate" BehaviorID="ModalPopupExtender1" DropShadow="true"
BackgroundCssClass="modalBackground">
</asp:ModalPopupExtender>
<asp:Panel ID="pnlpopup" runat="server" BackColor="LightGray"
CssClass="modalPopup" Width="600px" Height="450px">
<asp:PlaceHolder ID="PlaceHolder1" Visible="false" runat="server">
<table class="style1">
<tr>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
Name:</td>
<td>
<asp:TextBox ID="txtName" runat="server" CssClass="textEntry"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtThoughtName" ErrorMessage="*" ValidationGroup="r"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Description:</td>
<td>
<asp:TextBox ID="txtDescription" TextMode="MultiLine" Columns="37"
Rows="5" runat="server" CssClass="textEntry"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="*" ControlToValidate="txtDescription" ValidationGroup="r"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Date:</td>
<td>
<asp:TextBox ID="txtDate" runat="server" Width="150px"></asp:TextBox>
<asp:CalendarExtender
ID="CalendarExtender1" runat="server" TargetControlID="txtDate">
</asp:CalendarExtender><asp:RequiredFieldValidator ID="RequiredFieldValidator4"
runat="server" ErrorMessage="*" ControlToValidate="txtDate"
ValidationGroup="r"></asp:RequiredFieldValidator>
</td>
</tr>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Button ID="btnUpdate" runat="server" CommandName="Update"
OnClick="btnUpdate_Click" Text="Create" ValidationGroup="r" Width="100px" />
<asp:Button ID="btnCancel" runat="server" onclick="btnCancel_Click"
Text="Cancel" Width="100px" /></td>
</tr>
</table>
</asp:PlaceHolder>
<asp:PlaceHolder ID="PlaceHolder2" Visible="false" runat="server">
<table class="style1">
<tr>
<td class="style6">
Join a Group:</td>
<td>
<asp:DropDownList ID="DropDownList1" runat="server"
DataSourceID="SqlDataSource3" DataTextField="GroupName"
DataValueField="GroupId">
</asp:DropDownList>
<asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">Create a Group</asp:LinkButton>
</td>
</tr>
<tr>
<td class="style6">
</td>
<td>
<asp:Button ID="btnUpdate3" runat="server" CommandName="Update"
Width="160px" OnClick="btnUpdate2_Click" Text="Join Group" ValidationGroup="a" />
<asp:Button ID="btnCancel3" runat="server" onclick="btnCancel2_Click"
Width="160px" Text="Cancel" />
</td>
</tr>
<tr>
<td class="style6">
<asp:Label ID="Label3" Visible="false" runat="server" Text="Group Name:"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtgroupname" Visible="false" CssClass="textEntry" runat="server"></asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator3" ControlToValidate="txtgroupname" ValidationGroup="z" runat="server" ErrorMessage="*"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="style6">
</td>
<td>
<asp:Button ID="Button2" Visible="false" ValidationGroup="z" runat="server"
Width="160px" Text="Create New Group" onclick="Button2_Click" />
<asp:Button ID="Button3" Visible="false" runat="server" Width="160px"
Text="Cancel" onclick="Button3_Click" />
</td>
</tr>
</table>