Hi,
I have 2 dropdownlist controls.
I bind the controls when the page loads.
However, when I select from the dropdownlist the page reloads and the bindings are reset. Meaning that the default value is always selected.
How do I fix this? Below is my code. Thanks.
if (!IsPostBack)
{
NameList.DataSource = NameDataSet;
NameList.DataTextField = "Name";
NameList.DataValueField = "Name";
NameList.DataBind();
DateDropDownList.DataSource = DateDataSet;
DateDropDownList.DataTextField = "Date";
DateDropDownList.DataValueField = "Date";
DateDropDownList.DataBind();
name = NameList.Text;
date = DateTime.Parse(DateDropDownList.Text);
loadData();
}
else {
}
View Full Details...............................
No comments:
Post a Comment