日期:2014-05-20  浏览次数:20701 次

关于datagrid中嵌套dropdownlist,怎么写dropdownlist的OnSelectedIndexChanged事件?
htm:
<ItemTemplate> <asp:DropDownList   id= "ddlscore "   runat= "server "   Width= "100% "   OnSelectedIndexChanged= "ddl_SelectedIndexChanged "AutoPostBack= "True "> </asp:DropDownList>
</ItemTemplate>
cs:
private   void   ddl_SelectedIndexChanged(object   sender,   System.EventArgs   e)
{
用这个报错,那到底应该在cs页面怎么写呢?
}

------解决方案--------------------
up!!
------解决方案--------------------
帮你up
------解决方案--------------------
private void ddl_SelectedIndexChanged(object sender, System.EventArgs e)
{

}

private 改成protected 试试,具体报什么错发上来看看
------解决方案--------------------
该方法是点击dropdownlist时所要得到的是value 还是text可以用个变量来接收他
this.label1.Text = DropDownList1.SelectedItem.Text;
this.label1.Text = DropDownList1.SelectedValue.ToString();

------解决方案--------------------
用事件委托