I have used update panel to do partial postback in asp.net webform page but instead of partial load it reload hole page and I used combobox to do postback with onSelectIndexChanged event my code:
<asp:UpdatePanel runat="server" ID="updatePanel1" >
<ContentTemplate>
<table style="direction:rtl;width:416px;" runat="server" clientidmode="Static">
<tr class="trwidth">
<td>
<asp:DropDownList ID="comboCategory" runat="server"
DataTextField="job_name" DataValueField="job_cat_id" DataSourceID="SqlDataSource1">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:JobsConnectionString %>"
SelectCommand="SELECT * FROM [job_category]"></asp:SqlDataSource>
</td>
<td>
<asp:DropDownList ID="comboCountry" runat="server" AutoPostBack="True" ClientIDMode="Static" DataSourceID="SqlDataSource3"
OnSelectedIndexChanged="comboCountry_OnSelectedIndexChanged"
DataTextField="country_name" DataValueField="country_id">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$ ConnectionStrings:JobsConnectionString %>"
SelectCommand="SELECT * FROM [country]"></asp:SqlDataSource>
</td>
</tr>
<tr class="trwidth">
<td>
<asp:DropDownList ID="comboCity" runat="server" DataSourceID="SqlDataSource2" ClientIDMode="Static"
DataTextField="city_name" DataValueField="location_id">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:JobsConnectionString %>"
SelectCommand="SELECT * FROM [location]"></asp:SqlDataSource>
</td>
<td>
<asp:DropDownList ID="comboGender" runat="server"
DataSourceID="SqlDataSource4"
DataTextField="gender_name" DataValueField="gender_id" ClientIDMode="Static">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource4" runat="server"
ConnectionString="<%$ ConnectionStrings:JobsConnectionString %>"
SelectCommand="SELECT * FROM [gender]"></asp:SqlDataSource>
</td>
</tr>
<tr class="trwidth">
<td colspan="2" style="text-align:center;padding-left: 130px;direction: ltr">
<dx:ASPxDateEdit ID="ASPxDateEdit" runat="server" NullText="دوا بەروار">
</dx:ASPxDateEdit>
</td>
</tr>
<tr class="trwidth"><td></td>
<td class="dxtcLeftAlignCell">
</td>
<td></td><td></td></tr>
<tr class="trwidth"><td> </td>
<td class="dxtcLeftAlignCell">
</td>
<td> </td>
<td> </td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
code behind:
protected void comboCountry_OnSelectedIndexChanged(object sender, EventArgs e)
{
try
{
SqlDataSource2.SelectCommand = "SELECT * FROM [location] where [country_id]=" +
comboCountry.SelectedValue;
comboCity.DataBind();
}
catch (Exception exception)
{
Debug.WriteLine(exception.Message);
} }
As such, I don't see any issue with the mark-up - are you setting any updatepanel properties in the code behind?
Another try could be using explicit trigger declaration or registration - for example
or equivalent code such as
You may also try changing
ClientIDMode
of those combo-boxes to AutoID or Predictive.