使用比较验证器时出现问题 [英] Problem ocuured when using Compare Validator

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

问题描述

我在表格中使用了比较验证器"来检查密码"文本框和确认密码"文本框.

我在.aspx.cs文件中编写的代码.

if(page.Isvalid)
{
label1.Text =验证成功";
}
其他
{
label1.Text =不成功"; f
}

在这里,当我在两个文本框中输入相同的字符串时,发生postaback.Label文本正在显示.但是,当我在文本框中输入不同的文本时...页面回发不会发生.即使没有显示标签文字消息.
谁能帮助我.

I used Compare validator in a form to check the "Password" textbox with "Confirm Password" textbox.

Code i wrote in .aspx.cs file.

if(page.Isvalid)
{
label1.Text="Validation Successful";
}
else
{
label1.Text="Not Suceessful";f
}

Here when i enter same string in two textboxes, postaback is occuring.Label text is displaying. But when i am giving different text in the textboxes... page postback is not happening. Even it is not showing label text msg.
Can anyone plz help me out.

推荐答案

使用比较验证器属性.

右键单击比较验证器,然后单击properties.

从那里,您将看到验证器的behaivior.只需选择"control to validate"和"control to compare"的位置



希望对您有帮助.
祝你好运. :)



-chaosgray-
use the compare validator properties.

right click on compare validator, then properties.

from there, you will see the behaivior of the validator. just choose where to "control to validate" and "control to compare"



hope it helps.
goodluck. :)



-chaosgray-


请不要以明文形式存储密码!这里有一个提示/技巧来解释为什么不这样做:密码存储:操作方法. [^ ]
Please do not store passwords in clear text! There is a tip/trick explaining why not here: Password Storage: How to do it.[^]


在属性"菜单上:

选择控制"以确认密码"验证属性,然后选择控制以将属性与密码进行比较".
On the Properties Menu:

Choose Conrol to Validate property with Confirm Password and Control to Compare Property with Password.


这篇关于使用比较验证器时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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