Are you calling FillDropDown() in the Page_Load event handler? if so does it look like this:
if(!IsPostBack)
{
FillDropDown();
}
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)
{
TxtEditTaskCode.Text = DropDownList1.SelectedValue;
TxtEditTaskDesc.Text = DropDownList1.SelectedItem.Text;
}
1. Why hit database when you already have the data in the drop down.
2. DropDownList1.SelectedItem.Text is the 'Description' DropDownList1.SelectedValue is the 'Code'.
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68