Visual Studio .NET - Dropdownlist in update panel

Asked By Manju R on 19-Mar-07 04:21 PM

I tried this sample test form and it works fine - listbox is updated on selection changed event of the other and only that portion is updated. I have to use this in my application but the dropdown boxes are in different cells/ sections in a table.

<form id="form1" runat="server">

<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering ="true"/>



<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode ="Conditional" >


<asp:DropDownList ID="DropDownList1" runat="server" DataTextField="fieldname" DataValueField="fieldname" autopostback="true" OnSelectedIndexChanged ="DropDownList1_SelectedIndexChanged">


<asp:DropDownList ID="DropDownList2" runat="server" DataTextField="Text" DataValueField="Val">



<Triggers >

<asp:AsyncPostBackTrigger ControlID ="DropDownList1" EventName ="SelectedIndexChanged" />



<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode ="conditional" >


<asp:Button ID="Button1" runat="server" Text="Button" /><br />

<asp:Label ID="Label1" runat="server" Text="Label" Width="152px"></asp:Label>





Here's the code from my form -

<td><asp:UpdatePanel ID="updateRecipe" runat="server" UpdateMode ="Conditional" >

<ContentTemplate><asp:DropDownList ID="JobDescription" runat="server" DataTextField="Text" DataValueField="val" Width="150px" CssClass ="grdData" AutoPostBack="True" OnSelectedIndexChanged ="JobDescription_SelectedIndexChanged">

</asp:DropDownList> </ContentTemplate><Triggers >

<asp:AsyncPostBackTrigger ControlID ="JobDescription" EventName ="SelectedIndexChanged" />


This updates two dropdown lists. Do I have to wrap all dropdownboxes in one update panel or have them in separate updatepanels? How do i trigger the events. What I have here doesn't work.

Use the ASP.NET AJAX CascadingDropDown Control - K Pravin Kumar Reddy replied to Manju R on 19-Mar-07 10:20 PM

Use the ASP.NET AJAX CascadingDropDown Control

check out example

This video demonstrates how ASP.NET’s standard DropDownList can become AJAX-enabled using the CascadingDropDown control extender from the ASP.NET AJAX Control Toolkit. You will also see how easy it is for a web form to draw its data from an XML Web Service.