2008-11-17 71 views
1

當我單擊彈出式窗口中的按鈕以將數據插入數據庫時​​,它什麼都不做,WHYYYYY?ASP.NET ModalPopup不執行代碼

<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" BehaviorID="popup" TargetControlID="cmdTrigger" 
      PopupControlID="pnlPopup" BackgroundCssClass="modalBackground" 
      OkControlID="btnOk" > 
    </cc1:ModalPopupExtender> 
    <asp:Panel ID="pnlPopup" runat="server" CssClass="modalpopup" Style="display: none"> 
     <div class="container"> 
      <div class="header"> 
       <asp:Label ID="Label1" runat="server" CssClass="msg" Text="Add a new Entry" /> 
       <asp:LinkButton ID="LinkButton1" runat="server" CssClass="close" OnClientClick="$find('popup').hide(); return false;" /> 
      </div> 
      <div class="body"> 
       <asp:Label ID="Label2" runat="server" CssClass="msg" Text="Name" /> 
       <asp:TextBox ID="txtName" runat="server" Width="346px"></asp:TextBox> 
       </div> 
      <div class="footer"> 
       <asp:Button ID="btnOk" runat="server" Text="Save" Width="48px" /> 
       <asp:Button ID="btnCancel" runat="server" Text="Cancel" Width="50px" OnClientClick="$find('popup').hide(); return false;" /> 
      </div> 
     </div> 
    </asp:Panel> 

在btnOK的代碼是

簡單textbox1.text = txtName的

我甚至試圖設置斷點,沒有正在執行按鈕點擊事件。有任何想法嗎?

編輯〜解決方案

關注http://forums.asp.net/t/1070213.aspx

+0

它實際上是在回發嗎? – 2008-11-17 03:13:53

+0

我想要。我不知道還有什麼要嘗試。我照你所說的做了,並添加了一個明確的處理程序同樣的垃圾! – 2008-11-17 04:46:58

回答

2

取出OkControlId財產,因爲我認爲它可以防止回發從發生的歷史。

0

刪除CausesValidation="false"要麼成功。它會工作。