ASP.NET定制的校验错误消息:控制酒店所引用无法验证 [英] ASP.NET Custom Validator Error Message: Control referenced by the property cannot be validated

查看:155
本文介绍了ASP.NET定制的校验错误消息:控制酒店所引用无法验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用ASP.NET,并有一个按钮和一个的CustomValidator,其中有验证
按钮。

I use ASP.NET and have a Button and a CustomValidator, which has to validate the button.

<asp:Button ID="saveButton" runat="server" OnClick="SaveButton_Click" Text="Speichern"
    CausesValidation="true"/>
<asp:CustomValidator runat="server" ID="saveCValidator" Display="Static"
    OnServerValidate="EditPriceCValidator_ServerValidate"   
    ControlToValidate="saveButton" ErrorMessage="">

在加载页面时,我收到错误消息:

When loading the page, I receive the error message:

控制saveButton通过引用
  的ControlToValidate属性
  saveCValidator无法验证。

"Control 'saveButton' referenced by the ControlToValidate property of 'saveCValidator' cannot be validated."

可能是什么问题?我在网上搜索,但这个didn't多大帮助。

What might be the problem? I searched on the net, but this didn´t help much.

推荐答案

您只能使用<一个href=\"http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.customvalidator.aspx\">CustomValidator针对接受用户输入输入控件:

客户端验证增强
  通过检查用户验证过程
  之前输入被发送到服务器。

Client-side validation enhances the validation process by checking user input before it is sent to the server.

您想要做的是看看这里的<一个href=\"http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.aspx#ButtonControlsAndValidation\">Button控制和验证。

What you want to do is look here at Button Controls and Validation.

这篇关于ASP.NET定制的校验错误消息:控制酒店所引用无法验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆