62,046
社区成员
发帖
与我相关
我的任务
分享
protected void GvProList_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if(e.Row.FindControl("RaBut5") != null)
{
RadioButton btn5 = (RadioButton)e.Row.FindControl("RaBut5");
btn5.CheckedChanged += new EventHandler(mySelfRadioCheckeChanged);
}
else
{
Page.RegisterStartupScript("abc", "<script language='javascript'>alert('找不到radio');</script>");
}
}
}
28.简单委托示例.
public delegate void test(string t1);
public void t1(string p1)
{
p1 = "t1";
Response.Write(p1);
Response.Write("\r\n");
}
public void t2(string p2)
{
p2 = "t2";
Response.Write(p2);
}
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
//声明
test delegateOjb;
//关联方法
delegateOjb = t1;
delegateOjb += t2;
//传参才触发。
delegateOjb("begin");
}