我在ASP.net中设计了一个模态弹出窗口。任务是当我点击我的按钮时,它必须显示一个模态弹出框。我也使用了AJAX扩展器控制套件。以下是我的编码。
Approval.aspx:
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"/>
<div>
<asp:Button ID="ApproveButton" runat="server" Text="Approve" />
<ajaxToolkit:ModalPopupExtender ID ="mp1" runat="server" PopupControlID="Panel1"
TargetControlID="ApproveButton" CancelControlID="CancelButton">
</ajaxToolkit:ModalPopupExtender>
<!--Modal Panel "Panel1"-->
<asp:Panel ID="Panel1" runat="server" Height="170px" Width="506px">
<table style="width: 100%; height: 164px;">
<tr>
<td>
<asp:Label ID="ReasonLabel" runat="server" Text="Reason for Approval"></asp:Label>
</td>
<td>
<asp:TextBox ID="ReasonTextBox" runat="server" Height="126px"
TextMode="MultiLine" Width="336px"></asp:TextBox>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="OkButton" runat="server" Text="Ok" Width="66px" />
<asp:Button ID="CancelButton" runat="server" Text="Cancel" />
</td>
</tr>
</table>
</asp:Panel>
<!--Modal Panel-->
</div>
问题是,当我点击按钮时,弹出窗口只是闪烁一次。它不会永久显示弹出窗口。