Partial Class LoopExamples3 Inherits System.Web.UI.Page Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click 'create a variable to store the input from the textbox on the web page Dim Number As Integer = Input.Text 'create a variable to store the sum of 1 to the user's number Dim Sum As Integer = 0 'use a for-loop to add up the sum of 1 to the user's number For index = 1 To Number Sum = Sum + index Next 'send the results to the label on the web page Output.Text = "The sum of 1 to " & Number & " is " & Sum End Sub End Class