infor.aspx.cs public void Cancel_OnClick(object sender,System.EventArgs e) { Response.Write("Cancel_OnClick"); }in your code, do you have <%@ Page AutoEventWireup="true" %>or<%@ Page AutoEventWireup="false" %>but infor.aspx.csprotected Button Cancel;...Cancel.Click += new EventHandler(Cancel_OnClick);?
按钮删了重建 要不行就重启.net 还不行就新建这个页面
to sauser: 没有啊,在infor.aspx中是<%@ Page AutoEventWireup="false" %> 在infor.aspx.cx中,我是自己建立的 public void Cancel_OnClick(object sender,System.EventArgs e) { //Server.Transfer("index.aspx"); Response.Redirect("index.aspx"); }还有阿,你所写的 infor.aspx.cs public void Cancel_OnClick(object sender,System.EventArgs e) { Response.Write("Cancel_OnClick"); } 是什么意思?
Is there a row like:this.Button1.Click += new System.EventHandler(this.Button1_Click);
normally, <asp:Button> triggers form submission and invokes validation functions along the way, if you don't want to, set the button's CausesValidation=false
public void Cancel_OnClick(object sender,System.EventArgs e)
{
Response.Write("Cancel_OnClick");
}in your code, do you have <%@ Page AutoEventWireup="true" %>or<%@ Page AutoEventWireup="false" %>but infor.aspx.csprotected Button Cancel;...Cancel.Click += new EventHandler(Cancel_OnClick);?
要不行就重启.net
还不行就新建这个页面
没有啊,在infor.aspx中是<%@ Page AutoEventWireup="false" %>
在infor.aspx.cx中,我是自己建立的
public void Cancel_OnClick(object sender,System.EventArgs e)
{
//Server.Transfer("index.aspx");
Response.Redirect("index.aspx");
}还有阿,你所写的
infor.aspx.cs
public void Cancel_OnClick(object sender,System.EventArgs e)
{
Response.Write("Cancel_OnClick");
}
是什么意思?
没有啊 我是自己建立的public void 事件响应函数
把OnClick="Cancel_OnClick"去掉,就可以,我刚测试过