SolutionCottage.com
Posted  31 Mar 2009 - 09:17:11

Category: ASP.net


DropDownList does not remember selected value

Issue
When you select a different index in a dropdownlist control and expect the value to change, it doesn't.

Solution
You're probably databinding this control on Page_Load. Add a check around the databinding statement, like this:

protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
brandChooser.DataSource = datasource;
brandChooser.DataBind();
}
}








0 comments:








© SolutionCottage 2008-2011 7/21/2017 3:37:21 AM