This is a migrated thread and some comments may be shown as answers.

UserControl with AJAX in RadMenuItem

1 Answer 50 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
Fit2Page asked on 08 Jun 2011, 03:29 PM
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

1 Answer, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 14 Jun 2011, 12:34 PM
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.

Tags
Menu
Asked by
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Kate
Telerik team
Share this question
or