ASP.NET WebForm dropdownList事件未触发

时间:2015-09-08 11:17:11

标签: javascript webforms asp.net-3.5

我试图在ASP.NET 3.5 WebForm中调用OnSelectedIndexChanged事件但事件由于某种原因未触发。我已经在另一个应用程序上测试了这段代码并正在运行....

 <cc1:SpiffyPanel ID="pnlGrade" runat="server" Visible="false">
        <table>
            <tr>
                <td class="field">
                    Grade
                </td>
                 <td>&nbsp;</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;
            }
        }
     }

0 个答案:

没有答案