首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

刚学asp.net,想请教怎么在web控件里,后台添加c#代码

2013-08-24 
刚学asp.net,想请问如何在web控件里,后台添加c#代码?比如,我想添加一个Botton控件点击设计按钮,就能进入到

刚学asp.net,想请问如何在web控件里,后台添加c#代码?
比如,我想添加一个Botton控件



点击设计按钮,就能进入到设计页面了,
代码里面就是这样
刚学asp.net,想请教怎么在web控件里,后台添加c#代码
[解决办法]
引用:
在该控件的点击事件中的代码
    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);
    }
此两种方法都可以。

+1

热点排行