you use the custom validation for date validation or regularexpression validator for enter time in correct form you write java script for time validation which bind with coutom validation:
<pre lang="cs"><script type="text/javascript">
function validTime(source,args)
{
var res=false;
var orgVAlue=args.Value;
var hour=orgVAlue.substring(0,2);
var min=orgVAlue.substring(3,5);
var sec=orgVAlue.substring(6,8);
if(orgVAlue.length==0)
res=false;
else if(orgVAlue.length>8)
res=false;
else
{
if((hour>23)||(min>59)||(sec>59))
res=false;
else
res=true;
}
args.IsValid=res;
}
</script>
now i use with text box like:-
<pre lang="xml"><asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:CustomValidator ID="CustomValidator1" runat="server" ClientValidationFunction="validTime"
ControlToValidate="TextBox1" ErrorMessage="Not valid date" SetFocusOnError="True"
ValidateEmptyText="True"></asp:CustomValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="TextBox1"
ErrorMessage="Enter date in dd:mm:ss" SetFocusOnError="True" ValidationExpression="dd:dd:dd"></asp:RegularExpressionValidator><br />
<asp:Button ID="Button1" runat="server" Text="Button" />
Now you try this above code.