I wonder why does the dropdownlist always set to index 0. I have a function that dynamically fill the dropdownlist control, now every time that I select an item (example index 5) in the dropdownlist control it always goes to index 0. Can anyone help me. Thanks in advance.
are you repopulating the DropDownList on postback? (and is the DropDownList set to AutoPostback?)
The said function is just invoke in Page Load. Therefore, I am not repopulating it. Every time I click on the Button it always set to index 0. By the way the DropDownList AutoPostBack property is not set True.
This usually happens when you have EnableViewState set to false for page and such. Is thats the case you have to explicitly check the previously selected value of the DDL and set that selected on every page load.
Is that the case?
The said function is just invoke in Page Load
But are you checking for isPostback before populating the List from Page_Load? (You do realise that Page_Load is invoked with every page request, including postbacks? )