Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Validate a date
Message
 
À
14/07/2006 15:34:12
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Versions des environnements
Environment:
ASP.NET
Divers
Thread ID:
01136539
Message ID:
01141455
Vues:
16
>I have a ASP.Net webform that contains a textbox where a user should enter a date in mm/dd/yy format.
>
>How can I validate that the user enter a good date?
>
>Thanks,
>
>Jerry
Here is a simple way
        <asp:RequiredFieldValidator runat="server" Display="Dynamic" ControlToValidate="txtDOB" ErrorMessage="DOB is required.<br>"	ID="Requiredfieldvalidator2"></asp:RequiredFieldValidator>
        <asp:RegularExpressionValidator runat="server" Display="Dynamic" ControlToValidate="txtDOB" ErrorMessage="DOB is required as mm/dd/yyyy.<br>" ID="RegEDOB" ValidationExpression="\d{2}\/\d{2}\/\d{4}"/>        
Ricardo A. Parodi
eSolar, Inc.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform