I have a textbox in asp.net . and i want to enter only positive number in that text box.I have already used rangevalidator but it takes on -0 without error.please solve the porblem.
positive no
Collapse
X
-
Originally posted by prpI have a textbox in asp.net . and i want to enter only positive number in that text box.I have already used rangevalidator but it takes on -0 without error.please solve the porblem.Comment
-
Originally posted by prpI have a textbox in asp.net . and i want to enter only positive number in that text box.I have already used rangevalidator but it takes on -0 without error.please solve the porblem.Comment
-
Here's how we can accomplish this easily
Code:Imports System.Text.RegularExpressions Public Class BlahBlahBlah Private Sub NoNegativeZero()[INDENT] Dim MyRE As New Regex("^[0-9]+$") Dim MyMatch As Match = MyRE.Match(TextBox1.Text) If MyMatch.Success = False Then MsgBox("I'm not cool with -0") End If [/INDENT] End Sub End Class
# Anthony TowryComment
Comment