我想弄清楚爲什麼我的ModalPopupExtender保持關閉,每次用戶單擊其中一個按鈕時,它運行的代碼背後,因爲我把一箇中斷點,它打破了那裏,但modalPopup立即關閉,這不是好,因爲如果它在過程中有任何錯誤,他們不能顯示。那麼我該如何阻止modalpopup關閉自己?我沒有指定OKControlID或CancelControlID。ModalPopupExtender按鈕問題
面板代碼:
<asp:Panel ID="Panele" runat="server" style="display: none; position:absolute; top: 50%; left: 35%; width: 500px; height: 350px; background-color: White; border: solid 1px black; padding-left: 15px; text-align: left;">
<asp:ImageButton ID="CloseEBtn" runat="server"
ImageUrl="images/CloseButton.png" style="float: right; margin-right: 3px; margin-top: 3px;"
onclick="CloseEBtn_Click" />
<strong>Name:<asp:TextBox ID="fromTextBox" runat="server"></asp:TextBox></strong>
<asp:Button ID="SndBtn" runat="server" Text="Send" onclick="SndBtn_Click" />
<asp:Button ID="ClrBtn" runat="server" Text="Clear" />
<br />
<br />
<asp:Label ID="msglabel" runat="server"></asp:Label>
</asp:Panel>
我ModalPopupExtender代碼:
<asp:ModalPopupExtender ID="popup" runat="server"
TargetControlID="SIBtn" PopupControlID="Panele" BackgroundCssClass="modalBackground">
</asp:ModalPopupExtender>
代碼隱藏:
protected void SndBtn_Click(object sender, EventArgs e)
{
msglabel.Text = "The Window Didnt Close";
}
protected void ClrBtn_Click(object sender, EventArgs e)
{
fromTextBox.Text = "";
toTextBox.Text = "";
subjectTextBox.Text = "";
MessageTextBox.Text = "";
msglabel.Text = "";
}
請張貼您的codebehind方法以及 – 2011-03-22 17:42:50