Hi Everyone !
I have 2 DropDownList controls inside an UpdatePanel.
The first is a dropdown for Country while the second is for State.
I have set the properties of Country as AutoPostBack="True", OnSelectedIndexChanged ="PopulateState". Selecting a different Country fires the PopulateState function causing the the State to populate itself with the relevant states as well as state id (StateID and StateName are selected from the State table. The Country dropdown contains the CountryID and CountryName selected from the Country table).
Outside the UpdatePanel, there is a Button control, say "Submit Form". This runs a sql Select statement, picking up the CountryID value from the Country DropDownList, as well as the StateID from the State DropDownList.
On my development server, the State dropdown is populated very fast. Hence, when I click on Button Control, I get the expected results.
However, on the production server when a different Country is selected, it takes about 5+ seconds for the (partial page update) State dropdown to have the relevant StateID and StateName.
I tried setting the Button's Enable property to false at the start of the PopulateState function and then to true at the end of the function. This does not work.
Please tell me...
1. How to disable the Button contol when the Country is changed and then enable it again when the States have been populated(ie for the 5+ seconds it takes for the partial page update)?
Thanks.