views:

21

answers:

2

Hi All,

I have a couple of dropdownlists and a button.when a user selects an item in the 1st dropdownlist,the 2nd dropdown is programmatically bound to a set of items(using an ajax request) depending on the value selected in the 1st dropdown.Then the user will have the ability to choose an item from the 2nd dropdown and click on the button,which performs some server side opeartions and returns the results.

But if the user tries to click on the button before the 2nd dropdown list is populated,user will receive an exception message.Instead of that I would like to prevent the user from clicking the button before the ajax request is completed to populate the 2nd dropdown.I tried using Button1.Enabled=false in the selectedvaluechanged event of 1st dropdown,which does n't seem to work.

Could someone please help me achieve this?

Thanks.

A: 

You could do it client side, after the ajax request has completed.

TAkinremi
A: 

If you're using the Ajax Control Toolkit you can use CascadingDropDown object.

http://www.asp.net/ajax/ajaxcontroltoolkit/samples/CascadingDropDown/CascadingDropDown.aspx

booyaa