Visual Web Developer 2010 Express
This is an ASP.net project
I have searched but wasn't successful
I have two text boxes and I need to make small calculator.
I have made one "IF" for checking is there something in textboxes, if they are empty then I get message that I didn't insert anything.
And if I insert numbers then I get the result.
This is ok.
I have a problem with validation
I need ONLY numbers to be inserted, if I insert something that is not integer I need a message that this is not a number.
Please, hlp.
This is my code :
Code:Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click If TextBox1.Text = ("") Or TextBox2.Text = ("") Then Label5.Text = ("Niste unjeli dva broja, pokusajte ponovo") Else Dim prvi As Integer = TextBox1.Text Dim drugi As Integer = TextBox2.Text Label5.Text = (prvi + drugi) End If End Sub






Reply With Quote