用web matrix,那你双击一下Button直接把代码写进去就行了
不需要this.Button1.Click += new System.EventHandler(this.Button1_Click);吧。
<asp:Button id="Button1" onclick="Button1_Click" runat="server" Text="Button"></asp:Button>看看这句有没有onclick="Button1_Click"?

解决方案 »

  1.   

    #region Web Form Designer generated code
    override protected void OnInit(EventArgs e)
    {
    //
    // CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
    //
    InitializeComponent();
    base.OnInit(e);
    }

    /// <summary>
    /// 设计器支持所需的方法 - 不要使用代码编辑器修改
    /// 此方法的内容。
    /// </summary>
    private void InitializeComponent()
    {    //////////////////////////////////////////////////////////////////////////////////
    加于此处!!!!!!!!!! this.DDL_unit.SelectedIndexChanged += new System.EventHandler(this.DDL_unit_SelectedIndexChanged);
    this.DDL_group.SelectedIndexChanged += new System.EventHandler(this.DDL_group_SelectedIndexChanged);
    this.tb_pwd.TextChanged += new System.EventHandler(this.Button1_Click);
    this.btn_certain.Click += new System.EventHandler(this.Button1_Click);
    this.Load += new System.EventHandler(this.Page_Load); }