在asp.net 2.0中,页面page中设置了autoeventwireup= "true "
页面上有一个RadioButtonList:
<asp:RadioButtonList ID= "rblChoice " runat= "server " RepeatDirection= "horizontal " AutoPostBack= "True " OnSelectedIndexChanged= "rblChoice_SelectedIndexChanged ">
此时OnSelectedIndexChanged事件是已经绑定,而且好使的
但是我需要在代码中进行判断,比如
if (_strState.Equals( "take "))
{
rblChoice.OnSelectedIndexChanged -= new Event(rblChoice_SelectedIndexChanged);
}
但是这样做并不好使,事件绑定依然有效。请问我应该怎么做才能取消掉这个事件绑定? 谢谢!
------解决方案--------------------------------------------------------
autoeventwireup= "false "
------解决方案--------------------------------------------------------
up