Time Validation in ASP.NET TextBox

Option 1:

You can use a RegularExpressionValidator control.

Drag and drop a
RegularExpressionValidator control on your ASP.NET page next to the control you want to validate and set it's ControlToValidate property to the ID of the TextBox. 

Set
ValidateExpression property : ^([1-9]|1[0-2]|0[1-9]){1}(:[0-5][0-9][aApP][mM]){1}$

Option 2:

1. Make sure AutoPostBack property of TextBox is True.

2. Write this code on TextChanged event handler of the TextBox.

Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim t As DateTime
        If (DateTime.TryParse(TextBox1.Text, t) = True) Then
        Else
          ' Show your error message here.
           
TextBox1.Focus()
        End If

    End Sub