mikebai.com

  • Home
  • dev
  • DotNET
  • M365
  • 搞笑
  • 杂七杂八
  • FocusDict
個人BLOG
it developer
  1. Main page
  2. DotNET
  3. Main content

验证控件笔记

2010-03-11 95hotness 0likes 0comments

1)from:http://dev.csdn.net/article/56/56880.shtm 

在asp.net 1.1中,对于验证类控件,在使用时,遇到有的不需要验证的控件时,是十分麻烦的,就是说不可能有选择验证某些控件,而在asp.net 2.0中,新增加了validationgroup属性,可以指定验证某些控件,例子如下:


<html>


<body>


     <form runat=“server”>


          <asp:textbox id=“TextBox1” runat=“server”/>


          <asp:requiredfieldvalidator ValidationGroup=“Group1”


                                                       ErrorText=“Need to Fill in Value!”


                                                       ControlToValidate=“TextBox1”


                                                       runat=“server”/>


 


            <asp:textbox id=“TextBox2” runat=“server”/>


            <asp:requiredfieldvalidator ValidationGroup=“Group2”


                                                         ErrorText=“Need to Fill in Value!”


                                               

Tag: Nothing
Last updated:2010-03-11

mikebai

This person is a lazy dog and has left nothing

Like
< Last article
Next article >

COPYRIGHT © 2025 mikebai.com. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang