postback issue with drop downlists with javascript
I have a problem with which I am struggling for many days.
I have a page which has six drop down list (which are webform elements and not html elements). Auto postback property is enabled for all the elements. The data in the dropdown lists are related in a hierarical fashion. Now to give you the general idea of the working of the page, suppose, When the client changes the selection in any of lists in the page (say list number 2), it updates the items of the subsequent lists (that is lists 3, 4, 5, 6). The process is database intensive, so it takes quite a while before any results comes up.
What I want is to prevent the client from changing the selection before their previous request is serviced, by disabling the dropdown lists in the page.
I am trying to use Javascript to disable the lists by adding a "OnChange" attribute to the dropdown list, in the Page_Load event of the page.
ddllist1.Attributes.Add("OnChange", "disable();")
ddllist2.Attributes.Add("OnChange", "disable();")
...........
ddllist6.Attributes.Add("OnChange", "disable();")
The disable function is defined on the <Head> of the aspx page. Now the trouble is, this "OnChange" event is suppressing the "OnSelectedIndexChanged" event of the dropdown lists!! So though the lists are getting disabled, when the client is changing the selection, the code in the "OnSelectedIndexChanged" is not executing and the lists are not getting updated.
Please suggest.
|