Dropdownlist value doesnot changed
I use dropdownlist to select the data from database.... I bind the data in dropdownlist from database... When i select the value from dropdownlist it will retrive the data from database.. but again selecting another data it disply same value....... If anybody know answer reply me..........
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Amit ChoudharyRank #145 · 15.8K reputationPosted Mar 18, 2010, 5:09 AM EDT
here is the solution
1. put your code of binding the dropdownlist inside that is inside page_load event under following condition:
if(!Page.IsPostBack)
{
// Dropdownlist binding code
}
2. Set the property EnableViewState=true of Dropdownlist.
and your problem will be solved.
Please mark as answer if it helps you.
SARAVANA PERUMAL12 reputationPosted Mar 18, 2010, 5:19 AM EDT
Amit ChoudharyRank #145 · 15.8K reputationPosted Mar 19, 2010, 4:33 AM EDT
if you are using asp.net dropdownlist then in your aspx page set the property like this...
Please mark as answer if it helps.