Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9128645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:33:51+00:00 2026-06-17T07:33:51+00:00

How can I determine if the value in my textbox is a correct date

  • 0

How can I determine if the value in my textbox is a correct date?

ex:
this is the value of the date in my Textbox:01/32/2013

I know that it is a wrong value of date, but how can I determine that it is a wrong format?
I can avoid that by using try and catch, but I don’t want to use it, I will use it if I don’t find a solution in my problem.

<asp:TextBox ID="txtMEditStartDt" runat="server" Text='<%# Bind("StartDt", "{0:MM/dd/yyyy}") %>'
    CssClass="datePicker" SkinID="textSkin" Width="100px"></asp:TextBox>
<asp:MaskedEditExtender ID="MaskedEditStartDt" runat="server"
    TargetControlID="txtMEditStartDt" Mask="99/99/9999" MaskType="Date" 
    CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" 
    CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
    CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True"/>
<asp:CalendarExtender ID="calendarEditStartDt" runat="server" TargetControlID="txtMEditStartDt" Format="MM/dd/yyyy">
</asp:CalendarExtender>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:33:52+00:00Added an answer on June 17, 2026 at 7:33 am

    You can use DateTime.TryParse method. In this method used is a current culture of applicaiton. So in case of failure, it will return simply false.

    DateTime dateValue = default(DateTime);
    if (DateTime.TryParse(dateString, out dateValue)) 
       //SUCCESS 
    else 
      //FAILURE
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can determine the current number of connections by db.serverStatus().connections but all that gives
How can I determine the initial value of a select item? This does not
Can somebody please let me know how we can determine if a local disk
How can I determine in KeyDown that ⇧ + Tab was pressed. private void
How can I determine SelectedCell 's Value In DataGrid ? (WPF) My DataGrid has
How do I determine the correct number of textbox (input type=text) in an html
How can i determine the value is changed in the select box without clicking
Some may or may not know that you can get the size of an
I know you should never compare floating point value using the == equality operator
I've been trying to write this query but can't seem to get it right

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.