Validation By Control ASP.Net

<%@ Page Language="C#" AutoEventWireup="true"%>



    Validation groups


function CheckMembership(source, arguments)
{
  arguments.IsValid = false;
  var buf = arguments.Value;
  if (buf == "Normal" || buf== "Silver" ||
            buf == "Gold" || buf == "Platinum")
    arguments.IsValid = true;
}


    
        
      
          
              
            
          
              
            
          
          
              
            
          
              
            
          
              
            
          
              
            
      
Name*
                                    ControlToValidate="fname" 
                  Text="!!!"
                    ErrorMessage="Name is mandatory" />
Last Name*
                                    ControlToValidate="lname" 
                  Text="!!!"
                    ErrorMessage="Last name is mandatory" />
Age
                                    ValidationGroup="PersonalDataGroup"
                    ControlToValidate="age" 
                  Operator="GreaterThanEqual" 
                  ValueToCompare="18"
                    Type="integer"
                    ErrorMessage="Age must be at least 18." />
Email
                                    ValidationGroup="PersonalDataGroup"
                    ControlToValidate="email" 
                  ValidationExpression="[a-zA-Z_0-9.-]+\@[a-zA-Z_0-9.-]+\.\w+" 
                    ErrorMessage="Must be an email address." />
Hire Date
                                       ValidationGroup="PersonalDataGroup"
                    ControlToValidate="hired" 
                  Display="Static"  
                  Operator="DataTypeCheck" 
                    Type="date"
                    ErrorMessage="Must enter a date." />
                                       ValidationGroup="PersonalDataGroup"            
                    ControlToValidate="hired" 
                  Display="Dynamic"
                    MinimumValue="2008-1-1"
                  MaximumValue="2008-12-31"
                    Type="Date"
                    ErrorMessage="Date after 1-1-99." />
Membership Level
                                        ValidationGroup="PersonalDataGroup"            
                    ControlToValidate="membership" 
                  ClientValidationFunction="CheckMembership"
                    ErrorMessage="Must be Gold or Platinum." />

      
        

      
      
        

                    ValidationGroup="NameGroup"
        ShowMessageBox="false" 
        ShowSummary="true" 
        HeaderText="The following errors occurred: (no message-box)"
        DisplayMode="List" />
                    ValidationGroup="PersonalDataGroup"
        ShowMessageBox="true" 
        ShowSummary="true" 
        HeaderText="The following errors occurred:"
        DisplayMode="BulletList" />