新建一个web窗体的问题
新建一个web窗体,default.aspx页面不做定义
在default.cs文件中创建
DropDownList oSelectAppearance = new DropDownList();
DropDownList oSelectSpeed = new DropDownList();
下拉框,设置自动回发
oSelectAppearance.AutoPostBack = true;
oSelectSpeed.AutoPostBack = true;
这时候要在后台设置他们的OnSelectedIndexChanged事件应该怎样设置呢~?
在msdn帮助写的该OnSelectedIndexChanged事件是protected的阿~
求教各位大大了
------解决方案--------------------DropDownList oSelectAppearance = new DropDownList();
DropDownList oSelectSpeed = new DropDownList();
oSelectAppearance.SelectedIndexChanged += new EventHandler(oSelectAppearance_SelectedIndexChanged);
void oSelectAppearance_SelectedIndexChanged(object sender, EventArgs e)
{
throw new Exception( "The method or operation is not implemented. ");
}
------解决方案--------------------protected void Page_Load(object sender, EventArgs e)
{
DropDownList1.SelectedIndexChanged += new EventHandler(DropDownList1_SelectedIndexChanged);
}
void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
throw new Exception( "The method or operation is not implemented. ");
}