Last post Aug 28, 2017 06:42 AM by Deepak Panchal
Aug 25, 2017 01:18 PM|Muhammad irfan|LINK
I have one table in a de-normalized form Named 'Category Classification' in which i have 4 fields like Category, Subcategory, Brand and Company. I want to develop a searching criteria on asp.net in which the scenario would be: * If i select category from
the drop down, It should automatically show the subcategories associated with that selected category in the next drop down of the subcategory. *Same goes for the brand as well. If i select the subcategory, The grid should appear with the check boxes of the
related brands of that selected subcategory.
The screen shot of the said criteria is attached along.
I need the logic behind the denormalized database like Microsoft excel has that functionality which i need to implement on asp.net.
Your help would be highly appreciated.
Aug 28, 2017 06:42 AM|Deepak Panchal|LINK
from the description, I understand that you want to load another dropdown based on the selection in current drop down.
other thing you had mentioned that you want to populate it with checkboxes.
so I suggest you to use checkbox list instead of dropdown.
you can try to use "SelectedIndexChnaged" event of Checkbox list.
on this event you can try to take the selected data and fire a query in the database and populate the other checkbox list with the data generated by the query.
you can try to refer code below.
private void PopulateHobbies()
using (SqlConnection conn = new SqlConnection())
conn.ConnectionString = ConfigurationManager
using (SqlCommand cmd = new SqlCommand())
cmd.CommandText = "select * from hobbies";
cmd.Connection = conn;
using (SqlDataReader sdr = cmd.ExecuteReader())
ListItem item = new ListItem();
item.Text = sdr["Hobby"].ToString();
item.Value = sdr["HobbyId"].ToString();
item.Selected = Convert.ToBoolean(sdr["IsSelected"]);