我正在尝试根据使用selectedindexchanged
选择另一个下拉列表来填充一个下拉列表。第二个选择将用户带到另一个页面。这有效,但如果用户回击。记住该部分,并且重新选择导致用户被发送到先前的选择。因此,如果用户回击,我需要以某种方式重置索引。
protected void btnCommitteeKeywordSearch_Click(object sender, EventArgs e)
{
ddCommitteeCategory.Items.Clear();
ddCommitteeList.Items.Clear();
panSelectaCommittee.Controls.Clear();
if (!string.IsNullOrWhiteSpace(CommitteeKeywordSearch.Text) || CommitteeKeywordSearch.Text != "Select a committee")
{
Response.Redirect("/IPA/IPAStaging2016/About/Committees_keywordsearch.aspx?Code=" + CommitteeKeywordSearch.Text);
}
}
protected void ddCommitteeCategory_SelectedIndexChanged(object sender, EventArgs e)
{
if (!string.IsNullOrWhiteSpace(ddCommitteeCategory.SelectedItem.Value))
{
//nothing
}
}
protected void ddCommitteeList_SelectedIndexChanged(object sender, EventArgs e)
{
if (!string.IsNullOrWhiteSpace(ddCommitteeList.SelectedItem.Value) || CommitteeKeywordSearch.Text != "Select a committee")
{
Response.Redirect("/IPA/IPAStaging2016/Committees/Committee_Detail.aspx?Code=" + ddCommitteeList.SelectedItem.Value);
}
}