T
tarscher
hi all,
I have a dropdownist that doesn't keep it's selected previous state.
When I select an item i want the selected item to be selected when the
postback happened. The DDL looks like this
<aspropDownList ID="keywordsDropDownList" runat="server"
AutoPostBack="True"
OnSelectedIndexChanged="keywordsDropDownList_SelectedIndexChanged"
Someone has an idea what I do wrong?
protected void AddButton_Click(object sender, EventArgs e)
{
myController = new Controller();
myTest = new Test(0, NameTextBox.Text,
DescriptionTextBox.Text);
NameLabel.Text = "Enter keywords for " + myTest.Name;
keywordsDropDownList.DataSource =
myController.GetKeywordTemplates();
keywordsDropDownList.DataValueField = "Id";
keywordsDropDownList.DataTextField = "KeywordParameter";
keywordsDropDownList.DataBind();
MultiView1.SetActiveView(KeywordView);
}
When the dropdownbox selection is changed:
protected void keywordsDropDownList_SelectedIndexChanged(object sender,
EventArgs e)
{
AddButton_Click(sender, e);
}
I have a dropdownist that doesn't keep it's selected previous state.
When I select an item i want the selected item to be selected when the
postback happened. The DDL looks like this
<aspropDownList ID="keywordsDropDownList" runat="server"
AutoPostBack="True"
OnSelectedIndexChanged="keywordsDropDownList_SelectedIndexChanged"
</aspropDownList>
Someone has an idea what I do wrong?
protected void AddButton_Click(object sender, EventArgs e)
{
myController = new Controller();
myTest = new Test(0, NameTextBox.Text,
DescriptionTextBox.Text);
NameLabel.Text = "Enter keywords for " + myTest.Name;
keywordsDropDownList.DataSource =
myController.GetKeywordTemplates();
keywordsDropDownList.DataValueField = "Id";
keywordsDropDownList.DataTextField = "KeywordParameter";
keywordsDropDownList.DataBind();
MultiView1.SetActiveView(KeywordView);
}
When the dropdownbox selection is changed:
protected void keywordsDropDownList_SelectedIndexChanged(object sender,
EventArgs e)
{
AddButton_Click(sender, e);
}