对特定控件进行验证 [英] Cause validation to specific control

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

问题描述

我在一页中具有以下控件
//==================================
具有RequiredField-Validator1的TextBox1
具有RequiredField-Validator2的TextBox2
Button1(对于TextBox1,应仅 启用CuaseValidation)
Button2(对于TextBox2,应仅 启用CuaseValidation)
//================================
我该如何实现.

I have the following control in one page
//====================================
TextBox1 with RequiredField-Validator1
TextBox2 with RequiredField-Validator2
Button1 (CuaseValidation should be enabled only for TextBox1)
Button2 (CuaseValidation should be enabled only for TextBox2)
//==================================
How can I achieve this.

推荐答案

通过google搜索,只需点击两下即可.

首先使用Google,您会发现这一点! [
Two clicks away from here via google search.

USE GOOGLE FIRST AND YOU WILL FIND THIS![^]


嗨 您需要为(TextBox1,Button1)和(TextBox2,Button2)提供验证组.


Hi You need to provide validation group for (TextBox1,Button1) and (TextBox2,Button2)


<asp:Button ID="Button1" runat="server" ValidationGroup="Grp1" Text="Button" />
<asp:TextBox ID="TextBox1" runat="server" ValidationGroup="grp1"></asp:TextBox>

<asp:Button ID="Button2" runat="server" ValidationGroup="Grp2" Text="Button" />
<asp:TextBox ID="TextBox2" runat="server" ValidationGroup="grp2"></asp:TextBox>



谢谢,
Imdadhusen



Thanks,
Imdadhusen


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

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