CausesValidation 设置为true,同时执行了客户端和服务器端的验证。
CausesValidation 设置为false,不进行验证,但你click事件里执行了服务器端的验证

解决方案 »

  1.   

    CausesValidation 设置为true,同时执行了客户端和服务器端的验证。
    CausesValidation 设置为false,不进行验证,但你click事件里执行了服务器端的验证.同意
      

  2.   

    设置CausesValidation为true 的button1仅仅是比Page.Validate()多执行OnClick,OnCommand.看不出这两个是进行客户端验证了.
    见如下button中代码
    void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)
    {
        if (this.CausesValidation)
        {
            this.Page.Validate();
        }
        this.OnClick(new EventArgs());
        this.OnCommand(new CommandEventArgs(this.CommandName, this.CommandArgument));
    }
      

  3.   

    1把Button1的CausesValidation设置为false
    ValidationSummary1的ShowMessageBox设置为true,ShowSummary也设置为trueButton1的事件如下:
    private void Button1_Click(object sender, System.EventArgs e)
    {
    Page.Validate();
    }
    当页面有没有通过的验证时候:不弹出对话框,仅仅在页面上显示错误信息
    -----------------------------------------------------------
    那像上面这么做有办法让它弹出错误提示吗?