Validation By Control ASP.Net

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

    void valComments_ServerValidate(Object source, ServerValidateEventArgs args)
    {
        if (args.Value.Length > 10)
            args.IsValid = false;
        else
            args.IsValid = true;
    }



    Show CustomValidator


    
    

    
            id="lblComments"
        Text="Comments:"
        AssociatedControlID="txtComments"
        Runat="server" />
        
            id="txtComments"
        TextMode="MultiLine"
        Columns="30"
        Rows="5"
        Runat="server" />    
            id="valComments"
        ControlToValidate="txtComments"
        Text="(Comments must be less than 10 characters)"
        OnServerValidate="valComments_ServerValidate"
        Runat="server" />
        
    
    
            id="btnSubmit"
        Text="Submit"
        Runat="server" />