Tips and tricks for .NET using ASP and VB code.

Validate Number From TextBox

Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
Dim NumberValue As Double = Nothing
If Double.TryParse(TextBox1.Text, NumberValue) Then
Diagnostics.Debug.WriteLine("Valid number is: " & NumberValue)
End If
End Sub

No comments:

Post a Comment

Search This Blog