Validated Textbox Controls

Validated Textboxes Controls
The DateBox Control validates to the US format mm/dd/yyyy
 
The PhoneBox Control validates to the US format XXX-XXX-XXXX  - [Area Code] - [Prefix] - [Last Four]
 
The Social Security Control validates US format XXX-XX-XXXX  - [First 3 digits] - [Second 2 digits] - [Last Four digits]
 
The ZipcodeBox Control validates to the US format 00000-0000 - [First 5 digits] - [Last Four digits] or just the first 5 digits only.
 
The NumericBox Control validates to the format 0-9 numeric value only also allows period after the decimal point.
 
See sample below it requires the ncToolControls.dll which you can download it for personal and commercial use.
royalty free distribution.
 
ncToolControls can be used with VB.NET  ASP.NET Pages
 
ncToolControls.dll must be placed in your project bin folder
 
Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@ Register Assembly="ncToolControls" Namespace="ncToolControls" TagPrefix="nc" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
         <p>
            <asp:ValidationSummary ID="ValidationSummary1" ShowMessageBox="true" ValidationGroup="fldGrpVal" runat="server" />             
            
            <asp:Label ID="label1" Text="Date:" runat="server"></asp:Label>
            <nc:DateTextBox ID="txtDTBox1" Width="80px" validationGroup="fldGrpVal" runat="server"></nc:DateTextBox>            

            <asp:Label ID="label2" Text="Phone:" runat="server"></asp:Label>
            <nc:PhoneTextBox ID="txtPh" Width="90px" validationGroup="fldGrpVal" runat="server" />            
            
            <asp:Label ID="label6" Text="State:" runat="server"></asp:Label>
            <nc:UnitedStatesListing ID="ddlStates" validationGroup="fldGrpVal" runat="server"></nc:UnitedStatesListing>

            <asp:Label ID="label3" Text="Zipcode:" runat="server"></asp:Label>
            <nc:ZipcodeTextBox ID="txtZip" Width="60px" validationGroup="fldGrpVal" runat="server" />
            
            <asp:Label ID="label4" Text="Social:" runat="server"></asp:Label>
            <nc:SocialSecTextBox ID="txtSocial" Width="90px" validationGroup="fldGrpVal" runat="server" />            
            
            <asp:Label ID="label5" Text="Numeric:" runat="server"></asp:Label>
            <nc:NumbericTextBox ID="txtNumb" validationGroup="fldGrpVal" Width="70px" runat="server"></nc:NumbericTextBox> 
            <asp:Button ID="btnSubmit" Text="Submit" OnClick="btnSubmit_Click" ValidationGroup="fldGrpVal" runat="server" />
        </p>                   
        <nc:MessageBox ID="msgCtrl" BoxMessageType="success" runat="server" />
    </div>
    </form>
</body>
</html>
Default.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            string ALL_TEXT_BOXES_INPUT = "Date: " + this.txtDTBox1.Text + " Phone: " + txtPh.Text + " Zipcode: " + txtZip.Text + " Social: " + txtSocial.Text + " Numeric: "+txtNumb.Text + " State: " + ddlStates.Text;
            this.msgCtrl.ContentMessageText = ALL_TEXT_BOXES_INPUT;
        }
    }
}
Download ncToolControls Controls here ncToolControls.zip [Version: 2.0.3.2] for .NET Framework 4.0 or higher.

Add Feedback