
Partial Class MetricConverterQueryString
    Inherits System.Web.UI.Page

    Protected Sub cmdConvert_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdConvert.Click

        Dim Inches, Meters As Single
        Inches = 36 * Val(txtYards.Text) + 12 * Val(txtFeet.Text)
        Meters = Inches / 39.37
        lblResult.Text = "Wynik w metrach: " & Meters.ToString() & ". "

        ' Pobieranie informacji o stanie.
        Dim Counter As Integer = CType(ViewState("Counter"), Integer)

        ' Aktualizacja licznika i wyświetlenie wyników.
        Counter += 1
        lblResult.Text &= "Liczba przekształceń: " & Counter.ToString() & "."

        ' Zapisywanie nowej wartości.
        ViewState("Counter") = Counter

        'Dim QueryString As String
        'QueryString = "?Yards=" & txtYards.Text & "&Feet=" & txtFeet.Text

        '' Send the information to the QueryStringResult page
        '' and redirect the user there.
        'Response.Redirect("QueryStringResult.aspx" & QueryString)

    End Sub
End Class
