ModalPopupExtender
控件無法正常工作。問題是,當點擊彈出的「OK」按鈕時,「OK」按鈕後面的代碼不起作用。請指導我解決問題。請參閱下面的代碼,ModalPopupExtender無法正常工作
<ATK:ModalPopupExtender
BackgroundCssClass="ModalPopupBG"
DropShadow="true"
OkControlID="btnDone"
CancelControlID="btnCancel"
runat="server"
PopupControlID="AddTopic"
id="ModalPopupExtender1"
TargetControlID="btnAddNew"/>
<asp:Panel ID="AddTopic" runat="server" CssClass="popup_Container" >
<div class="popup_Titlebar" id="PopupHeader">
<div class="TitlebarLeft">
Add New Topic
</div>
<div class="TitlebarRight" onclick="cancel();">
</div>
</div>
<div class="popup_Body">
<asp:Label ID="lblTopic" runat="server" Text="Topic Name"> </asp:Label>
<asp:TextBox ID="tbTopicName" runat="server" Width="400px" ></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ErrorMessage="*" ControlToValidate="tbTopicName">
</asp:RequiredFieldValidator>
<br /> <br />
<span style="padding-left:350px">
<asp:Button ID="btnDone" runat="server" Text="Ok" onclick="btnDone_Click"/>
<input id="btnCancel" value="Cancel" type="button" OnClick="cancel();" />
</span>
</div>
</asp:Panel>
最後,我決定「確定」按鈕沒有被刪除OkControlID
財產射擊的問題。但是,現在執行「OK」單擊事件後,彈出窗口將關閉,並立即再次顯示彈出窗口的原始大小,然後再次關閉。如何解決這個問題。請指導我。
嗨,我已經刪除了'RequiredFieldValidator',之後它也沒有觸發「確定」按鈕事件 –