2012-04-23 155 views
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)

希望帮助假的!

相关问题