UserControl with AJAX in RadMenuItem

2 posts, 0 answers
  1. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 08 Jun 2011 Link to this post

    I have a RadMenu in Mega Drop Down mode.
    A childitem is added, and a UserControl is added to the child.

    Code for adding the UserControl dynamically:
    e.Item.GroupSettings.ExpandDirection = ExpandDirection.Down
    e.Item.GroupSettings.OffsetX = "-476"
     
    childItem = New RadMenuItem()
    childItem.CssClass="MenuSlide"
    e.item.Items.Add(childItem)
     
    Dim uc_Products As products = DirectCast(LoadControl("~/includes/products/products.ascx"), products)
    childItem.Controls.Add(uc_Products)
    In the userControl there is a Repeater which must be Ajaxified so that it can be updated while the menu item is expanded.
    I try it like so:

    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default" />
     
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Width="600px" EnableAJAX="true"
    LoadingPanelID="RadAjaxLoadingPanel1" EnablePageHeadUpdate="True"
    HorizontalAlign="NotSet">
     
    <asp:Button Text="productlines" id="btn_productlines" runat=server />
     
    <asp:Repeater id="rpt_Footer" runat="server" OnItemCommand="UpdateProductGroups"
    <HeaderTemplate><ul class="ProductFooter"></HeaderTemplate>
    <ItemTemplate>
    <li style="float:left;">
     
    <asp:Literal runat=server id="ltl_rewrite" Text='<%# Container.DataItem("rewrite") %>' />
     
    <asp:ImageButton
    ImageUrl='<%#FormatThumbnail(Container.DataItem("foto"))%>'
    Tooltip='<%#Container.DataItem("description")%>'
    id="btn_Type" runat="server" />
    </li>
    </ItemTemplate>
    <FooterTemplate></ul></FooterTemplate>
    </asp:Repeater>
    <asp:Label runat=server id="aa" Text="aaa" />
    </telerik:RadAjaxPanel>
    And in the CodeBehind:
    Sub UpdateProductGroups(ByVal Sender As Object, ByVal e As RepeaterCommandEventArgs)
    aa.Text = "bbb"
    End Sub
    When I click in the Repeater a full Postback is occuring instead of an Ajax update.

    Any suggestions?

    Thanks,
    Marc
  2. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 14 Jun 2011 Link to this post

    Hello Fit2Page,

    I tested the scenario that you describe but I am not able to reproduce the issue that you encounter. Please take a look at the attached page and let me know if I am missing something. For the simple test i bind the menu item to a simple array. I also set AnimationDuration property, so that the ajax update animation can be visible. 

    Greetings,
    Kate
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top