public DataTable GetDepInfo() { try { StringBuilder str = new StringBuilder(@"SELECT Id,Name FROM dbo.Sys_DepInfo WHERE Is_Active='1' AND DepinfoType='1'"); DataTable data = SqlDbHelper.GetDataTable(str.ToString()); if (data.Rows.Count > 0) { return data; } else { return null; } } catch (Exception) { return null; } }
在页面加载的时候调用DropDownListDataBind()方法
触发RadioButtonList的点击事件
protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e) { string Id; Id = RadioButtonList1.SelectedValue; GetDataBind(Id); }
既可以实现点击某个单选按钮,并触发事件。