刚学asp.net,想请问如何在web控件里,后台添加c#代码?比如,我想添加一个Botton控件
在该控件的点击事件中的代码 protected void Button1_Click(object sender, EventArgs e) { Response.Redirect("Default1.aspx"); }或者 protected void Button1_Click(object sender, EventArgs e) { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "window.open('Default1.aspx')",true); }此两种方法都可以。