我试图在ASP.NET 3.5 WebForm中调用OnSelectedIndexChanged事件但事件由于某种原因未触发。我已经在另一个应用程序上测试了这段代码并正在运行....
<cc1:SpiffyPanel ID="pnlGrade" runat="server" Visible="false">
<table>
<tr>
<td class="field">
Grade
</td>
<td> </td>
<td class="answer"><asp:DropDownList ID="ddlGrade" runat="server" OnSelectedIndexChanged="ddlGrade_SelectedIndexChanged" AutoPostBack="true" /></td>
</tr>
</table>
</cc1:SpiffyPanel>
...
protected void ddlGrade_SelectedIndexChanged(object sender, EventArgs e)
{
if (sender != null)
{
DropDownList _dropdownObj = (DropDownList)sender;
var selectValue = _dropdownObj.SelectedItem.Text;
}
}
}