3
Reply

how we take only numeric value in a text box.

aditya kumar

aditya kumar

16y
4.3k
0
Reply

    First of all,u take one TextBox1 control then used to FilterTextboxExtender under AjaxControl.Now go to properties of FilterTextboxExtender n choose the TargetID properties and write the Textbox1 Id(Bydefault ID will be Textbox1)there. Now go to TextBox1 Properties there will be auto create the FilterTextbox Property there willbe one option ValidChars.So here u will put this following 0123456789 characters there.

    Hai Aditya! There is a method isNumeric(object as expression).By using this method you can get only numbers in the text box. The Sample Code: In Visual Basic: =========================================================== Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Not IsNumeric(TextBox1.Text) Then MsgBox("Enter only the numbers:") End If End Sub ========================================================== I think this is very helpful to you ! Try and Reply

    You have to use Regular Expression Validator provide by dot net. ex: ^[0-9]$