大家好,我的一个模板里的一个服务器按钮,事件无法响应,事件是在.cs里面写的
protected System.Web.UI.WebControls.Button Button1;声名
然后
private void InitializeComponent()
{
Button1=new Button();
this.Button1.Click += new System.EventHandler(this.Button1_Click); }
然后在写 private void Button1_Click(object sender, System.EventArgs e)
{
this.Response.Redirect ("webform2.aspx");
}
没用啊,点击没有反映啊,帮帮忙啊谢谢了
protected System.Web.UI.WebControls.Button Button1;声名
然后
private void InitializeComponent()
{
Button1=new Button();
this.Button1.Click += new System.EventHandler(this.Button1_Click); }
然后在写 private void Button1_Click(object sender, System.EventArgs e)
{
this.Response.Redirect ("webform2.aspx");
}
没用啊,点击没有反映啊,帮帮忙啊谢谢了
解决方案 »
- =====DropDownList联动的问题=====
- UI层(WinForm/Web)控件数据绑定、映射与查询
- 访问发布好的网站,数据库不能连接,再再请教请教
- 一个关于postedFile的问题,请孟子老大帮忙看看。
- 请教关于在VS2005中GRIDVIEW中模板控件问题!
- 如何控制javascript的前一个,后一个
- 100分求一个好用的ComboBox组件(可编辑下拉框)
- 如何把object型转化为int?
- asp.net刷新页面后如何使下拉列表的选中项不改变
- 问一个数组的问题和问一个代码共享的问题
- 是不是在写.net程序时候,尽量不要直接使用 WINDOWS API ,为了确保程序跨平台性
- asp.net的两个小问题,求各位帮忙,谢谢!
看看
然后
private void InitializeComponent()
{
Button1=new Button();
this.Button1.Click += new System.EventHandler(this.Button1_Click); }
然后在写 private void Button1_Click(object sender, System.EventArgs e)
{
this.Response.Redirect ("webform2.aspx");
}
就是这么写的啊
你可以直接在HTML页面中写上该按钮的事件,后台写上相应的事件代码即可调用,不需要使用后台代码委托.
我的那个模板是DATAGRID里的一个TemplateColumn。你能说的详细吗?急急啊
{
if(e.CommandName=="Button1")
{}
}