Hi, So i've got a web page that has various drop down menus on them. The first one is for processes and the second for activities. I was wanting the second drop down list (activities) to only show the activities related to that process. I'm only starting ASP.NET so not sure how to accomplish this. I am using stored procedures on SQL Managemenent Studio and have created one to display the list of processes and one for the activities. I have also got object data sources for both drop dowm lists. The Process one is working fine, it displays the various different processes available. Could anyone give me any information on how the process drop down list contols the second one and how i could get this working.

Thanks :)

Recommended Answers

All 4 Replies

hi,create an event on dropdown_selectedChanged for the proccess one,and catch its value through dd.selectedValue,then call your procedure and bind the result in the second dropdown.

If you are just starting and do not have the experience to develop the VB or C# code, you can also get this working through the Design view.

On the second drop down, when you attach a datasource to this control, during the data source wizard, when you create the SQL Select Statement, specficy the WHERE clause and during the wizard, just specify that the value that you will use in the WHERE clause will come from the first dropdown list control, selected value. Then you just make sure that the first drop down list has the "auto post back" setting enabled so that when you select the value from the first drop down list, the page reloads and the second drop down list will display the results based on the SQL that is bound to it.

I was thinking I could do it that way but the place I work want me to use Object data sources and stored procedures.

Never mind I got it working the way you said JorgeM so I will leave it as it is.

Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.