验证控制怀疑 [英] validation control doubt

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

问题描述

我有两个按钮。

1)搜索按钮

2)返回按钮重定向到另一页



我在一个文本框中有一个必需的字段验证器。然后是验证控件。



当我点击搜索按钮而不输入任何内容。 showmessagebox这是真的..显示消息你必须输入价值



但是当我点击后退按钮..显示我同样的消息,我不要......请指导我

i have two button.
1)search button
2)back button to redirect to another page

I have a required field validator on one text box. Then a validation control.

when i click on search button without entering anything. the showmessagebox which is true..displays the message "you must enter value"

But when i am clicking the back button ..its showing me the same message which i dont want...kindly guide me

推荐答案

亲爱的Anurag,



这很简单,你可以这样做有两种方式。



1.设置Validation控件的ValidationGroup属性和Search按钮的值相同,假设为S



其他方式只需更改后退按钮的validationGroup属性,使用一些不同的值。



如果我的回答可以帮助你,请解决它。



谢谢和问候

Suman Zalodiya
Dear Anurag,

It's very simple, you can do this in two ways.

1. Set the ValidationGroup property of the Validation control and Search button with the same value suppose "S"

Other way just change the validationGroup property of your Back button with some different value.

Please make it resolved if my answer helps you.

Thanks and regards
Suman Zalodiya


您可以使用属性 CausesValidation =false作为按钮
You can use the Property CausesValidation="false" for the Button


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

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