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..........
Amit ChoudharyPosted Mar 19, 2010, 8:33 AM
if you are using asp.net dropdownlist then in your aspx page set the property like this...
Please mark as answer if it helps.
SARAVANA PERUMALPosted Mar 18, 2010, 9:19 AM
Amit ChoudharyPosted Mar 18, 2010, 9:09 AM
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.