Validation ASP.Net Tutorial

RequiredFieldValidator: require a user to enter a value in a  form field.
RangeValidator:         check whether a value falls between a certain minimum and maximum value.
CompareValidator:       compare a value against another value or perform a data type check.
RegularExpressionValidator: compare a value against a regular expression.
CustomValidator:        perform custom validation.
ValidationSummary:      display a summary of all validation errors in a page.
<%@ Page Language="C#" %>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    void btnSubmit_Click(Object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            lblResult.Text = @"Product: " + txtProductName.Text
                + "Price: " + txtProductPrice.Text
                + "Quantity: " + txtProductQuantity.Text;
        }
    }



    Order Form


    
    

    

    Order Form
            id="lblProductName"
        Text="Product Name:"
        AssociatedControlID="txtProductName"
        Runat="server" />
    
            id="txtProductName"
        Runat="server" />
            id="reqProductName"
        ControlToValidate="txtProductName"
        Text="(Required)"
        Runat="server" />
    
            id="lblProductPrice"
        Text="Product Price:"
        AssociatedControlID="txtProductPrice"
        Runat="server" />
    
            id="txtProductPrice"
        Columns="5"
        Runat="server" />
            id="reqProductPrice"
        ControlToValidate="txtProductPrice"
        Text="(Required)"
        Display="Dynamic"
        Runat="server" />
            id="cmpProductPrice"
        ControlToValidate="txtProductPrice"
        Text="(Invalid Price)"
        Operator="DataTypeCheck"
        Type="Currency"
        Runat="server" />
            id="lblProductQuantity"
        Text="Product Quantity:"
        AssociatedControlID="txtProductQuantity"
        Runat="server" />
    
            id="txtProductQuantity"
        Columns="5"
        Runat="server" />
            id="reqProductQuantity"
        ControlToValidate="txtProductQuantity"
        Text="(Required)"
        Display="Dynamic"
        Runat="server" />
            id="CompareValidator1"
        ControlToValidate="txtProductQuantity"
        Text="(Invalid Quantity)"
        Operator="DataTypeCheck"
        Type="Integer"
        Runat="server" />
            id="btnSubmit"
        Text="Submit Product Order"
        OnClick="btnSubmit_Click"
        Runat="server" />
    

            id="lblResult"
        Runat="server" />