Validation By Control ASP.Net

<%@ Page Language="VB" %>

    Sub Page_PreRender()
        For Each valControl As BaseValidator In Page.Validators
            Dim assControl As WebControl = Page.FindControl(valControl.ControlToValidate)
            If Not valControl.IsValid Then
                assControl.BackColor = Drawing.Color.Yellow
            Else
                assControl.BackColor = Drawing.Color.White
            End If
        Next
    End Sub



    Show Validators


    
    

        
            id="lblFirstName"
        Text="First Name"
        AssociatedControlID="txtFirstName"
        Runat="server" />
        
            id="txtFirstName"
        Runat="server" />
            id="reqFirstName"
        ControlToValidate="txtFirstName"
        Text="(Required)"
        EnableClientScript="false"
        Runat="server" />   
     
    
        
            id="lblLastName"
        Text="Last Name"
        AssociatedControlID="txtLastName"
        Runat="server" />
        
            id="txtLastname"
        Runat="server" />
            id="reqLastName"
        ControlToValidate="txtLastName"
        Text="(Required)" 
        EnableClientScript="false"
        Runat="server" />   
     
     
     
             id="btnSubmit"
        Text="Submit"
        Runat="server" />