Hi,
I have a simple page that has a Literal, a Repeater/Datalist and a DropDownList. When there are no items in the Repeater the Literal is shown. When an Item from the DropDownList is selected the Repeater is updated and the Literal is turned off.
This scenario is a much simplified version of what am I trying to achieve, designed as proof of the error. The page works fine with a full postback or when using a regular AJAX UpdatePanel, but when I try to use the RadAjax Manager, the Literal updates as expected, but the Repeater does not (I have tried replacing the Repeater with a Datalist and get the same results).
Here is some sample code...
If I do this, it works...
Any Ideas?
I have a simple page that has a Literal, a Repeater/Datalist and a DropDownList. When there are no items in the Repeater the Literal is shown. When an Item from the DropDownList is selected the Repeater is updated and the Literal is turned off.
This scenario is a much simplified version of what am I trying to achieve, designed as proof of the error. The page works fine with a full postback or when using a regular AJAX UpdatePanel, but when I try to use the RadAjax Manager, the Literal updates as expected, but the Repeater does not (I have tried replacing the Repeater with a Datalist and get the same results).
Here is some sample code...
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
<AjaxSettings> |
<telerik:AjaxSetting AjaxControlID="DropDownList"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="Literal" /> |
<telerik:AjaxUpdatedControl ControlID="Repeater " /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
</AjaxSettings> |
</telerik:RadAjaxManager> |
<div> |
<ul> |
<asp:Literal id="Literal" runat="server">This list is empty.</asp:Literal> |
<asp:Repeater ID="Repeater" runat="server"> |
<ItemTemplate> |
<li> |
<%#Container.DataItem("Item")%> |
</li> |
</ItemTemplate> |
</asp:Repeater> |
</ul> |
<br /> |
<div> |
<asp:DropDownList ID="DropDownList" runat="server" AutoPostBack="true"> |
<asp:ListItem Text="Item One" Value="1" /> |
<asp:ListItem Text="Item Two" Value="2" /> |
<asp:ListItem Text="Item Three" Value="3" /> |
<asp:ListItem Text="Item Four" Value="4" /> |
<asp:ListItem Text="Item Five" Value="5" /> |
</asp:DropDownList> |
</div> |
</div> |
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load |
If Not IsPostBack Then |
LoadList() |
End If |
End Sub |
Sub LoadList() |
Repeater.DataSource = "MyDataSource" |
Repeater.DataBind() |
If Repeater.Items.Count > 0 Then |
Repeater.Visible = True |
Literal.Visible = False |
Else |
Repeater.Visible = False |
Literal.Visible = True |
End If |
End Sub |
Protected Sub DropDownList_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList.SelectedIndexChanged |
'Add the Item here |
LoadList() |
End Sub |
If I do this, it works...
<asp:UpdatePanel ID="UpdatePanel1" runat="server"> |
<ContentTemplate> |
<div> |
<ul> |
<li id="Literal" runat="server">This list is empty.</li> |
<asp:Repeater ID="Repeater" runat="server"> |
<ItemTemplate> |
<li> |
<%#Container.DataItem("BusinessName")%> |
</li> |
</ItemTemplate> |
</asp:Repeater> |
</ul> |
<br /> |
<div> |
<asp:DropDownList ID="DropDownList" runat="server" AutoPostBack="true"> |
<asp:ListItem Text="Item One" Value="17" /> |
<asp:ListItem Text="Item Two" Value="19" /> |
<asp:ListItem Text="Item Three" Value="20" /> |
<asp:ListItem Text="Item Four" Value="21" /> |
<asp:ListItem Text="Item Five" Value="22" /> |
</asp:DropDownList> |
</div> |
</div> |
</ContentTemplate> |
</asp:UpdatePanel> |
Any Ideas?