事件错误,应该在ItemDataBound事件中处理,类似如下
<%#Eval("M_Addate", "{0:yyyy-MM-dd}")%>
<%#Eval("M_Title")%>
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
RadioButtonList rbl1 = (RadioButtonList)e.Item.FindControl("RadioButtonList1 ");
rbl1.DataSource = this.Repeater1.DataSource;
rbl1.DataTextField = "M_Bit";
rbl1.DataValueField = "M_ID";
rbl1.DataBind();
}
}