Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
I visited some sites wherein when a user selects an option in a dropdownlist box, it
automatically displays another dropdownlist box which has options relevant to the selected option in 1st dropdownlist. please explain how to create this process in detail. Please suggest some options to do that. either jquery or any scripts or any such possible methods to perform this.
Posted

hi
check out the following links
link1[^]
link2[^]
link3[^]
link4[^]
 
Share this answer
 
Comments
Sriram Mani 16-Oct-12 7:28am    
thanks knvsatyanarayana,
all the links you provided are Good and useful.
Sriram Mani 16-Oct-12 8:26am    
the process which i'm willing to obtain is similar to this as simple as possible.
http://blueicestudios.com/chained-select-boxes/
Hi all,
I finally found a way to make my requirement work.
First, add the required dropdown boxes in the page we design and on C# page_load method, set the visible attribute of the dropdown boxes as false.
Ex:
protected void Page_Load(object sender, EventArgs e)
    {
presenttype.Visible = false;
}

Next step is to set the parent dropdown box's attributes as follows.
OnSelectedIndexChanged="sta_Change" AutoPostBack="true"

here sta_Change is the method where we are going to write the code for displaying the hidden dropdown boxes based on the selected option in parent dropdown box as follows.
C#
public void sta_Change(object sender, EventArgs e)
    {
        if (parentDropList.SelectedValue == "option")
        {
presenttype.Visible = true;
}
}

That's it.
When we run the page, after we select the value in parent dropdownbox, it automatically enables the child dropdownbox due to the attribute
AutoPostBack="true"


Thanks for all who read and replied my question. I hope the solution( already available in visual studio, but many of us are still unaware about this facility.) provided was useful and simple to everyone.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900