更新数据时的验证问题 [英] validation problem at the time of updating data

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

问题描述

我在这些字段中有一个员工注册表单,例如empname,add,mobileno,email,empphoto和yaa用户名和密码okkk我已经为所有其他字段添加了普通的requirefield验证器,但是对于用户名和密码,我已经使用javascript进行了验证。 ...现在它的一切都很好注册但现在在使用gridview的行命令事件更新数据时和使用empId作为主键的填充控制方法它将填充文本框中的所有数据但不填写用户名和密码,因为我不想更新用户名和密码但所有其他的东西所以在更新时它会显示用户名和密码需要但我不想改变它.....所以我怎么能解决这个问题????任何身体帮助我。 。

i have one employee registration form in that fields like empname,add,mobileno,email,empphoto and yaa Username and password okkk i have put normal requirefield validator for all other fields but for username and password i have put validation using javascript ....now its everything okk with registration but now at time of updating data using row command event from gridview and fill control method using empId as primary key it will fill all the data in textbox but not for username and password because i dont want to update username and password but all other things so at the time of updation it will show that username and password require but i dont want to change it ..... so how can i solve this issue ????any body help me ..

推荐答案





你可以做两件事。

首先,您可以删除UserName和Password的编辑模板。

其次,填写用户名和密码值,但是文本框只读或禁用。



在RowDataBound事件中,您可以将texbox设为只读或禁用。



确保您提供了正确的验证必填字段验证器的组。



希望它有所帮助。
Hi,

you can do two things.
First, you can remove edit template for UserName and Password.
Second, Fill user name and password values, but make the textboxes readonly, or disabled.

In the RowDataBound event, you can make the texboxes as readonly or disabled.

make sure you have provided correct validation groups for required field validators.

hope it helps.


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

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