必填字段验证器错误 [英] required field validator error

查看:95
本文介绍了必填字段验证器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用添加产品"表单,其中显示了当前所有可用的产品,也提供了一些文本框,管理员可以在其中添加新产品.
我正在使用必填字段验证程序来检查必填字段.

当我单击网格视图模板字段中的更新按钮以更新列时.
它显示消息,即使我没有在数据库中插入文本框的数据,也要先填写所有详细信息.

在此先感谢您.

I am using a Add product form in which i am showing all the products available currently also i am providing some text box in which Admin can add new product.
I am using required field validator for checking required fields.

When i am clicking on the update button in grid view template field to update a column.
It shows message of to first fill all the details even though i am not inserting the data of text box in the database.

Thanks in advance.

推荐答案

据我从问题描述中所得到的,只有在文本字段中输入任何内容,您才希望验证器起作用.但据我所知,您无法使用标准必填字段验证器来满足条件.当您单击表单上的某些内容时,它将验证关联控件的字段.您可以使用所需的如果"条件在.NET中尝试CustomValidator.
As far as I can get from your problem description that you would like your validator to work only if you have entered anything in the text field. But as far I know you cannot have conditions with the standard required field validator. It will validate for the field of the associated control aoon as you click something on the form. You may try CustomValidator in .NET with the required "if" conditions you would like to have.


这篇关于必填字段验证器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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