I am trying to populate another combobox based on the text selected in the first combo box...however , the event protected void ddlcity_SelectedIndexChanged(object sender, EventArgs e) is not firing ?
here is my code snippet :
protected void ddlcity_SelectedIndexChanged(object sender, EventArgs e)
{
SqlDataReader dr1 = null;
SqlCommand command = new SqlCommand("select category.category from category,city_master,wines_available where wines_available.city_id=city_master.city_id and wines_available.category_id=category.category_id and city_master.city_name= '" + ddlcity.SelectedItem+ "'", conn);
conn.Open();
dr1 = command.ExecuteReader(CommandBehavior.CloseConnection);
ddlcategory.DataSource = dr1;
ddlcategory.DataTextField = "Category";
ddlcategory.DataValueField = "Category";
ddlcategory.DataBind();
dr1.Close();
}
However , when i change the text in the first combobox second combo box(ddlcategory) does not get populated..plz help me out.
cya
Rohan