RequiredField验证器 [英] RequiredField Validator

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

问题描述



我在页面中有下拉菜单和文本框,并为它们都放置了必填字段验证器.如果我单击按钮,它将首先验证文本框而不是下拉列表.因为下拉列表位于第一行.如何解决此问题?

问候,
Dhilip

Hi,

I have dropdown and textbox in a page.I have put requiredfield validator for both of them. If i click on button it is validating for textbox first instead of dropdown.Because Dropdown is in first row.How can i fix this?

Regards,
Dhilip

推荐答案

检查以下内容以设置所需的字段验证器

http://asp.net-tutorials.com/validation/required-field-validator/ [ ^ ]

要将必需的字段验证器用于多列,请检查以下内容:

多个字段验证器-一个ASP.NET验证控件 [
check the following for setting up required field validator

http://asp.net-tutorials.com/validation/required-field-validator/[^]

To use required field validator for multiple columns, check this:

Multiple Fields Validator - An ASP.NET Validation Control[^]


这两个验证都将完成同时.

单击按钮之前是否要更改DropDownList的索引?
The validation will be done for both of them simultaneously.

Are you changing the index of the DropDownList before clicking the button?


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

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