Validating date in asp net c

There is an input mask on the textbox which forces input of xx/xx/xxxx.

I am trying to use a regular expression validator to enforce that a correct date is entered. My co-worker found this one on the internet but I can't really tell what it's doing.

I need to validate a date entered in a textfield (but is a Date Time anyway) and display the error to the user if there's some problem, like an invalid date (p.e. If I do insert an invalid date, I get a as expected, but I don't want to display this message to the user.

Is there a way to catch this exception and change the display text?

validating date in asp net c-28validating date in asp net c-44

Thanks for help No you are not, though the fact that you are now using a calendar control is a step in the right direction. in that format, tomorrow's datewould appear as 12/11/2008. i:\x20[AP]M) # required AM or PM )| # 24 hour format ( [01]\d|2[0-3]) #hours (:[0-5]\d)) #required minutes optional seconds ? # if there is a space followed by a digit check for time (? [1-9]|1[012]) # hours (:[0-5]\d) # optional minutes and seconds (? Below is my code: I believe that the dates have to be specified in the current culture of the application.You might want to experiment with setting Culture Invariant Values to true and see if that solves your problem.

Leave a Reply

  1. 100 gay dating service 18-Mar-2020 03:48

    Online dating has helped introduce thousands of compatible singles.

  2. Dark secret chat mobile 03-Sep-2020 10:47

    If your project doesn’t reference an earlier version of the Report Viewer control, you’re ready to add a Report Viewer control to your page.