C# コード ビハインドで DropDownList のインデックスを選択しようとしていますが、SelectedIndexChanged イベントが発生しません。それを行う正しい方法は何ですか?
DropDownListChapterTitles.SelectedIndex = 1;
protected void DropDownListChapterTitles_SelectedIndexChanged(object sender, EventArgs e)
{ }
DropDownListChapterTitles.SelectedIndex = 1;
// Call it yourself
DropDownListChapterTitles_SelectedIndexChanged(this, null);
マークアップを確認すると、次のようになります
<asp:DropDownList runat="server" ID="DropDownListChapterTitles" AutoPostBack="True"
OnSelectedIndexChange="DropDownListChapterTitles_SelectedIndexChanged">
</asp:DropDownList>
追加したOnSelectedIndexChange="DropDownListChapterTitles_SelectedIndexChanged"