按钮CausesValidation 和 页面的Validate CausesValidation 设置为true,同时执行了客户端和服务器端的验证。CausesValidation 设置为false,不进行验证,但你click事件里执行了服务器端的验证 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 CausesValidation 设置为true,同时执行了客户端和服务器端的验证。CausesValidation 设置为false,不进行验证,但你click事件里执行了服务器端的验证.同意 设置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));} 1把Button1的CausesValidation设置为falseValidationSummary1的ShowMessageBox设置为true,ShowSummary也设置为trueButton1的事件如下:private void Button1_Click(object sender, System.EventArgs e){Page.Validate();}当页面有没有通过的验证时候:不弹出对话框,仅仅在页面上显示错误信息-----------------------------------------------------------那像上面这么做有办法让它弹出错误提示吗? 再问一个,一个单纯的repeater,我想添加一个删除,事件,那个序号的查找始终觉得困难? 下拉框和按钮的问题 GridView如何實現以下功能? 求代码优化。SQL高手来 100分求一动态添加控件的解决方法,高手进!! 救急 怎么获得当前用户的名称和IP ??????????DropDownList动态输出,但为什么只显示一个值?在线等,马上结帐 问题求教? 存储数据中存在的问题9急 未将对象引用设置到对象的实例。 网络空间?????
CausesValidation 设置为false,不进行验证,但你click事件里执行了服务器端的验证.同意
见如下button中代码
void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)
{
if (this.CausesValidation)
{
this.Page.Validate();
}
this.OnClick(new EventArgs());
this.OnCommand(new CommandEventArgs(this.CommandName, this.CommandArgument));
}
ValidationSummary1的ShowMessageBox设置为true,ShowSummary也设置为trueButton1的事件如下:
private void Button1_Click(object sender, System.EventArgs e)
{
Page.Validate();
}
当页面有没有通过的验证时候:不弹出对话框,仅仅在页面上显示错误信息
-----------------------------------------------------------
那像上面这么做有办法让它弹出错误提示吗?