Share

Anthem.NET

The forum address has changed, you have been automatically redirected. Please update any bookmarks to use the new URL.

Subscribe

Dinamic user controls with anthem and ajax

You are viewing a single message from this topic. View all messages.

  1. 2009-04-02 21:15:25 UTC
    Hi I have a really urgent problem and need some advice...
    I'm using dynamic user controls with ajax.net controls inside. But when I load the control using a anthem button, the script reference of the ajax controls get lost.

    Here is the html body code in the page:

    <body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <asp:Panel ID="Panel1" runat="server">
    </asp:Panel>
    <asp:LinkButton ID="LinkButton2" runat="server" onclick="LinkButton2_Click">ASP ADD</asp:LinkButton>
    <anthem:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">Anthem ADD</anthem:LinkButton>
    </ContentTemplate>
    </asp:UpdatePanel>
    </form>
    </body>

    The buttons events:

    protected void LinkButton2_Click(object sender, EventArgs e)
    {
    Control prueba = LoadControl("WebUserControl1.ascx");
    this.Panel1.Controls.Add(prueba);
    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
    Control prueba = LoadControl("WebUserControl1.ascx");
    this.Panel1.Controls.Add(prueba);
    }

    User control HTML:

    <cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="TextBox1" PopupButtonID="Button1">
    </cc1:CalendarExtender>
    <asp:Button ID="Button1" runat="server" Text="Button" /><asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <asp:Panel ID="Panel1" runat="server">
    <asp:Panel ID="Panel2" runat="server">
    Header
    </asp:Panel>
    <asp:Panel ID="Panel3" runat="server">
    Body
    </asp:Panel>
    </asp:Panel>
    <cc1:DragPanelExtender ID="DragPanelExtender1" runat="server" DragHandleID= "Panel2" TargetControlID = "Panel1">
    </cc1:DragPanelExtender>

    that's it, please check the behavior in both cases.
    Thx
< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.