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

Repeater controls inside RadAjaxPanel doing full postback

1 Answer 206 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Rimma
Top achievements
Rank 1
Rimma asked on 21 May 2013, 02:29 PM
Hi, I have a Repeater inside a RadAjaxPanel, and each repeater item has a DropDownList with Autopostback.  When I change the DropDownList selection a full postback happens instead of a partial one.  I tried wrapping my repeater in an extra panel and add configuration to the AjaxManager but with no luck.  If I try to create settings programmatically on the DropDownList then no postback happens at all.  Can you please help?  Here is my code:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AjaxTest.aspx.cs" Inherits="AppointmentsScheduling.Web.AjaxTest" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
 
<head runat="server">
 
 <title></title>
 
</head>
 
<body>
 
 <form id="form1" runat="server">
 
 <telerik:RadScriptManager ID="ScriptManager" runat="server" EnableViewState="true"></telerik:RadScriptManager>
 
 <telerik:RadAjaxManager ID="AjaxManager" runat="server">
 
 <AjaxSettings>
 
 </AjaxSettings>
 
 </telerik:RadAjaxManager>
 
 <div>
 
 <telerik:RadAjaxPanel ID="AjaxActionPanel" runat="server">
 
 <asp:Repeater ID="AppointmentList" runat="server">
 
 <ItemTemplate>
 
 <div class="column statuscolumn">
 
 <asp:Label ID="lblStatus" runat="server" Text="* Status" AssociatedControlID="Status" CssClass="required" />
 
 <asp:DropDownList ID="Status" runat="server" AutoPostBack="true"
 
 onselectedindexchanged="Status_SelectedIndexChanged">
 
 <asp:ListItem Text="1" Value="1" />
 
 <asp:ListItem Text="2" Value="2" />
 
 </asp:DropDownList>
 
 </div>
 
 </ItemTemplate>
 
 </asp:Repeater>
 
 </telerik:RadAjaxPanel>
 
 </div>
 
 </form>
 
</body>
 
</html>

 

 

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
namespace AppointmentsScheduling.Web
{
    public partial class AjaxTest : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                AppointmentList.DataSource = new int[] { 1, 2, 3 };
                AppointmentList.DataBind();
            }
        }
 
        protected void Status_SelectedIndexChanged(object sender, EventArgs e)
        {
            var Status = (DropDownList)sender;
            var lblStatus = (Label)Status.Parent.FindControl("lblStatus");
            lblStatus.Text = "* Status " + Status.SelectedValue;
        }
    }
}

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 24 May 2013, 03:36 PM
Hi,

The problem with full postback of dropdown placed in a repeater is not related to RadAjaxPanel. As you can see from the attached sample page when I replaced the AjaxPanel with MS UpdatePanel behavior is the same. This means that the problem comes from the dropdown when it is placed in the repeater.

Moreover, if you use RadComboBox instead of DropDownList the ajax will work without problems.

Regards,
Pavlina
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Ajax
Asked by
Rimma
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or