hi
i have 2 dropdown list in my page these are my code
<asp:DropDownList ID="DDLzone1" runat="server" CssClass="DDlzone" OnSelectedIndexChanged="DDLzone1_SelectedIndexChanged" AutoPostBack="true">
</asp:DropDownList>
protected void DDLzone1_SelectedIndexChanged(object sender, EventArgs e)
{
DDLstore1.Items.Clear();
DDLstore1.Items.Add(new ListItem("select shopping center", ""));
DDLstore1.AppendDataBoundItems = true;
SqlCommand _cmd = new SqlCommand("selectcenter", _cn);
_cmd.CommandType = CommandType.StoredProcedure;
_cmd.Parameters.AddWithValue("@RegionID", DDLzone1.SelectedItem.Value);
try
{
_cn.Open();
DDLstore1.DataSource = _cmd.ExecuteReader();
DDLstore1.DataTextField = "Centername";
DDLstore1.DataValueField = "ID";
DDLstore1.DataBind();
}
catch (Exception ex)
{
throw ex;
}
finally
{
_cn.Close();
_cn.Dispose();
}
}
<asp:DropDownList ID="DDLstore1" runat="server" CssClass="DDLstore" AutoPostBack="true">
when users click on DDLzone1 value of DDlStorre1 will change
here for both ddl i set autopostback ="true" for this it change ddlstore when page is post back
i want when users click on DDLzone1 value of DDLStore1 be change without loading page again