public void Cancel_OnClick(object sender,System.EventArgs e)
{
//Server.Transfer("index.aspx");
Response.Redirect("index.aspx");
}

解决方案 »

  1.   

    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);?
      

  2.   

    按钮删了重建
    要不行就重启.net
    还不行就新建这个页面
      

  3.   

    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");
    }
    是什么意思?
      

  4.   

    Is there a row like:this.Button1.Click += new System.EventHandler(this.Button1_Click);
      

  5.   

    to Alexandria:
    没有啊 我是自己建立的public void 事件响应函数
      

  6.   

    在infor.aspx文件中
      把OnClick="Cancel_OnClick"去掉,就可以,我刚测试过
      

  7.   

    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