Buttons with Dynamically loaded UserControls doesn't fire "Ajax" Postback

4 posts, 0 answers
  1. Ricky
    Ricky avatar
    247 posts
    Member since:
    Jun 2007

    Posted 20 Feb 2008 Link to this post

    I dynamically (with RadAjaxManager) loaded a UserControl, called Uc1, where a UserControl, Uc2, resides within Grid's Template Column.
     Initially, the Grid is shown as follows:
     http://www.sendspace.com/file/i1pscp and when users click any LinkButton, the Uc1 belongging to that Column will be loaded as follows:

    The problem is clicking buttons within Red box will automatically fire ajax postbacks, while the button (within Uc2) in the Blue Box still raises normal postback. Why? How do I let buttons at Uc2 raise ajax postback as well?

    For c# code implemention, I assign each GridDataItem to Ajaxify the Container Panel where Uc1 resides. And the markup of Container_Panel is at bottom.

        protected void MsgGrid_ItemCreated(object sender, GridItemEventArgs e)
            if (e.Item is GridDataItem)
                GridDataItem item = (e.Item as GridDataItem);
                // Attach click event handler to Title_Btn
                LinkButton titleBtn = (LinkButton) item["ContentColumn"].FindControl("Title_Btn");
                titleBtn.Click += new EventHandler(TitleBtn_Clicked);

                // Set Ajax source and target
                Panel loadPanel = (Panel)item["ContentColumn"].FindControl("Container_Panel");
                RadAjaxManagerProxy1.AjaxSettings.AddAjaxSetting(item, loadPanel);


                    <asp:Panel ID="Container_Panel" runat="server">
                    <div runat="server" class="headerPanel" >
                        <%--<asp:Label ID="Title_Lbl" runat="server" Text='<%# Eval("Title") %>'></asp:Label>--%>
                        <div style="width:400px;min-width: 400px;float:left;">
                        <asp:LinkButton ID="Title_Btn" runat="server" Text='<%# Eval("Title") %>' style="width:200px;min-width: 200px;color:Navy"></asp:LinkButton>
                        <asp:Label ID="SourceName_Lbl" runat="server"  style="width:150px" ></asp:Label> <%-- Bind at runtime--%></div>
                        <div style="text-align:right;float:right ">
                        <asp:Label ID="CreateTime_Lbl" runat="server" Text='<%# Eval("CreateTime", "{0:G}") %>' ></asp:Label>
                        <div runat="server" style="clear:both;height:0px;display:none" id="Loading_Panel_container">
                        <dbwc:dynamiccontrolsplaceholder id="Loading_Panel" runat="server" ControlsWithoutIDs="DontPersist" ></dbwc:dynamiccontrolsplaceholder>


    Thanks for your help.

  2. Ricky
    Ricky avatar
    247 posts
    Member since:
    Jun 2007

    Posted 21 Feb 2008 Link to this post

    This problem stems from my misunderstanding.

    Sorry for the bothering.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Steve
    Steve avatar
    10941 posts

    Posted 22 Feb 2008 Link to this post

    Hello Ricky,
    Do you still need help with this or you've figured it out? You can drop a line with your solution in case somebody else encounters similar problems.

    Best wishes,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Ricky
    Ricky avatar
    247 posts
    Member since:
    Jun 2007

    Posted 22 Feb 2008 Link to this post

    In this case, RadAjaxManager works well, but it is me considering that I do not fire Ajax Call due to a server-side error.

Back to Top