try this if you want to validate textBox
bool isValid = true;
try
{
string dt = TextBox1.Text;
DateTime dateTime = DateTime.ParseExact(dt, "MM.dd.yy", System.Globalization.CultureInfo.InvariantCulture);
}
catch
{
this.Response.Write("Invalid Date entered<br>");
isValid = false;
}
this.Response.Write("isValid: " + isValid + "<br>");