Validate the string entered is of mm/dd/yyyy format
<p>I have a datepicker control for the users to pick the date, however, they also need to enter the date manually. As such, I need to validate the date entered by the user in the textbox.</p>

<p>Below is the code that I am using to validate </p>

<pre><code> DateTime Test;
       if ((!string.IsNullOrEmpty(strtdate)))
       {
           bool valid = DateTime.TryParseExact(strtdate, "MM/dd/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out Test);
       }
</code></pre>

<p>The date entered by the user is 6/29/2011, however it gives the bool valid value as false though it is correct.</p>

<p>What am I missing here? Please let me know, its urgent.</p>

<p>Thanks.</p>
