Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Ajax > ModalPopupExtender.Show
RadControls for ASP.NET are no longer supported (see this page for reference). In case you have inquiries about the Telerik ASP.NET AJAX controls, post them in the pertinent ASP.NET AJAX forums.

ModalPopupExtender.Show

Feed from this thread
  • davenaylor2000 avatar

    Posted on Jul 21, 2007 (permalink)

    Hello,

    I'm looking for some help with using the rad ajax panel and the Ajax control Toolkit - modal popup extender on the same page.

    I need the whole page to be ajax enabled, i also need to be able to show the modal popup extender from code behind. If i place the modal popup in the ajax panel, the line in code behind that calls the PopupExtender1.Show() does nothing.

    However, if i move the extender out of the ajax panel, i get errors in the javascript saying the page cannot have two components with the same id. this is referring to the popup extender and occurs whenever something causes a partial postback in the ajax panel.

    Could anyone explain why this is happening or whether i can fix it?

    I have included a sample ap that describes the behavior above. I also have the latest ajax version.

    Default.aspx

    <%@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %> 
     
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> 
    <%@ Register Assembly="RadAjax.Net2" Namespace="Telerik.WebControls" TagPrefix="radA" %> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml"
    <head runat="server"
        <title>Untitled Page</title> 
    </head> 
    <body> 
        <form id="form1" runat="server"
            <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
            <div>  <radA:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px" Width="300px" 
                    EnableAJAX="true" EnableOutsideScripts="true"
                <asp:UpdatePanel ID="UpdatePanel3" runat="server"
                    <ContentTemplate> 
                        <asp:Panel ID="Panel1" runat="server" Style="display: none" Width="700" Height="300"
                            loaded 
                            <asp:Button ID="Button2" runat="server" Text="Close" OnClick="Button2_Click" /> 
                        </asp:Panel> 
                        <cc1:ModalPopupExtender ID="PopupExtender1" runat="server" PopupControlID="Panel1" 
                            TargetControlID="hiddenPublishButton"  OkControlID="btnMFinish" 
                            CancelControlID="btnMClose"
                        </cc1:ModalPopupExtender> 
                        <asp:Button ID="btnMClose" runat="server" Style="visibility: hidden" /> 
                        <asp:Button ID="btnMFinish" runat="server" Style="visibility: hidden" /> 
                        <asp:Button ID="hiddenPublishButton" runat="server" Text="" Style="display: none" /> 
                        <asp:LinkButton ID="lb_publish" runat="server" OnClick="lb_publish_Click">Show</asp:LinkButton> 
                    </ContentTemplate> 
                    <Triggers> 
                        <asp:AsyncPostBackTrigger ControlID="lb_publish" EventName="Click" /> 
                    </Triggers> 
                </asp:UpdatePanel> 
               
                    <asp:Button ID="Button1" runat="server" Text="Button" /><asp:TextBox ID="TextBox1" 
                        runat="server"></asp:TextBox> 
                </radA:RadAjaxPanel> 
            </div> 
        </form> 
    </body> 
    </html> 

    Default.aspx.vb

    Partial Class _Default 
        Inherits System.Web.UI.Page 
     
        Protected Sub Button2_Click(ByVal sender As ObjectByVal e As System.EventArgs) 
            PopupExtender1.Hide() 
        End Sub 
     
        Protected Sub lb_publish_Click(ByVal sender As ObjectByVal e As System.EventArgs) 
            PopupExtender1.Show() 
        End Sub 
        Protected Sub Button1_Click(ByVal sender As ObjectByVal e As System.EventArgs) Handles Button1.Click 
            TextBox1.Text = Now.Date.ToString 
        End Sub 
    End Class 

  • Giuseppe Giuseppe admin's avatar

    Posted on Jul 23, 2007 (permalink)

    Hello davenaylor2000,

    We would suggest you to use RadAjax Prometheus instead of the classic RadAjax for ASP.NET in this scenario as the former is based on the ASP.NET AJAX engine and works seamlessly with the ASP.NET AJAX Toolkit controls.

    Hope this helps.


    Best wishes,
    Manuel
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

  • ankur avatar

    Posted on May 4, 2011 (permalink)

    same issue with latest version of RadAjaxPanel.
    plz help

  • Maria Ilieva Maria Ilieva admin's avatar

    Posted on May 9, 2011 (permalink)

    Hello Ankur,

    Could you please test the application by using regular asp UpdatePanel instead of RadAjaxPanel and let me know what the behaviour in this case is.

    Regards,
    Maria Ilieva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Ajax > ModalPopupExtender.Show