3

我試圖在頁面上使用模式彈出式擴展程序,所以當我單擊按鈕時,它必須顯示一個面板。這裏是我有:模式彈出式擴展程序未顯示面板按鈕單擊

<asp:UpdatePanel runat="server" ID="updPanel"> 
    <ContentTemplate> 
     <ajaxToolkit:ModalPopupExtender ID="mpeEmailComplete" runat="server" TargetControlID="btnTesting" 
      PopupControlID="pnl" OkControlID="btnOk" 
      BackgroundCssClass="modalBackground"> 
     </ajaxToolkit:ModalPopupExtender> 



     <asp:Panel ID="pnl" runat="server" style="display:none;"> 
      <asp:UpdatePanel ID="udp" runat="server"> 
       <ContentTemplate> 
        <asp:Panel runat="server" ID="pnlEmailComplete" Visible="false"> 
         <asp:Label runat="server" ID="lblTest" Text="Testing testing testing"></asp:Label> 
         <asp:Button runat="server" ID="btnOk" Text="OK" /> 
        </asp:Panel> 
       </ContentTemplate> 
      </asp:UpdatePanel> 
     </asp:Panel> 


     <asp:Button runat="server" ID="btnTesting" Text="Testing"/> 

    </ContentTemplate> 
</asp:UpdatePanel> 

但我不能讓面板彈出,當按鈕被點擊。任何人都知道爲什麼?

回答

0

您有任何的JavaScript錯誤,並在服務器端設置爲pnl.Visible=False;任何地方?

確保您已正確引用AjaxControlToolkitNuGet是添加引用的最簡單方法。

http://nuget.org/packages/ajaxcontroltoolkit

+0

添加CausesValidation =「false」不起作用。 – user1202606 2012-04-23 19:59:15

+0

查看更新...... – 2012-04-23 20:01:13

+0

我在那裏嘗試了不同的事情,它被刪除。仍然沒有或沒有它工作... – user1202606 2012-04-23 20:03:34

0
<asp:UpdatePanel ID="UpdatePanel1" runat="server"> 
    <ContentTemplate> 
     <asp:Button ID="Btnshow" runat="server" Text="Show" OnClick="Btnshow_Click" /> 
     <asp:Button ID="BtnTarget" runat="server" Text="Target" Style="display: none" /> 
     <asp:TextBox ID="TextBox1" runat="server"> 
     </asp:TextBox> 
     <input type="button" value="Get" onclick="abc()" /> 
     <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="BtnTarget" 
      PopupControlID="Panel1"> 
     </asp:ModalPopupExtender> 
     <asp:Panel ID="Panel1" runat="server" BackColor="Black" Width="300px" Height="300px"> 
      <asp:UpdatePanel ID="UpdatePanel2" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional"> 
       <ContentTemplate> 
        <asp:Button ID="BtnHide" runat="server" Text="Hide Button" OnClick="BtnHide_Click" /> 
       </ContentTemplate> 
       <Triggers> 
        <asp:AsyncPostBackTrigger ControlID="BtnHide" EventName="Click" /> 
       </Triggers> 
      </asp:UpdatePanel> 
     </asp:Panel> 
    </ContentTemplate> 
    <Triggers> 
     <asp:AsyncPostBackTrigger ControlID="Btnshow" EventName="Click" /> 
    </Triggers> 
</asp:UpdatePanel> 
+0

也許你可以解釋你的答案,爲什麼它是解決方案,而不是發佈未公開的標記斑點。謝謝。 – Kev 2012-07-29 13:30:18

1

你內心的面板可見=假。

<asp:Panel runat="server" ID="pnlEmailComplete" Visible="false"> *(change here)* 

所以,當你按下按鈕測試,該ModalPopupExtender正確引起的外面板顯示,但它顯示一種無形的內板,因此你在屏幕上看到什麼。

<asp:Panel ID="pnl" runat="server" style="display:none;"> *(this is ok)* 

要解決,只是猛拉可見=從外板(pnlEmailComplete)

希望幫助假的!

相關問題