Partial Public Class _Default Inherits System.Web.UI.Page Dim parsedValue As Integer Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Label1.Text = Integer.Parse(0) End Sub Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click If (Int32.TryParse(TextBox1.Text, parsedValue) And Int32.TryParse(TextBox2.Text, parsedValue)) Then 'Add the 2 numbers entered Label1.Text = Integer.Parse(Me.TextBox1.Text) + Integer.Parse(Me.TextBox2.Text) Else Label1.Text = Integer.Parse(0) End If End Sub Protected Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button2.Click If (Int32.TryParse(TextBox1.Text, parsedValue) And Int32.TryParse(TextBox2.Text, parsedValue)) Then 'Subtract one number from the other Label1.Text = Integer.Parse(Me.TextBox1.Text) - Integer.Parse(Me.TextBox2.Text) Else Label1.Text = Integer.Parse(0) End If End Sub Protected Sub Button3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button3.Click If (Int32.TryParse(TextBox1.Text, parsedValue) And Int32.TryParse(TextBox2.Text, parsedValue)) Then 'Multiply the 2 numbers entered Label1.Text = Integer.Parse(Me.TextBox1.Text) * Integer.Parse(Me.TextBox2.Text) Else Label1.Text = Integer.Parse(0) End If End Sub Protected Sub Button4_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button4.Click If (Int32.TryParse(TextBox1.Text, parsedValue) And Int32.TryParse(TextBox2.Text, parsedValue)) Then 'Divide the 2 numbers entered Label1.Text = Integer.Parse(Me.TextBox1.Text) / Integer.Parse(Me.TextBox2.Text) Else Label1.Text = Integer.Parse(0) End If End Sub End Class