Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using ToString in VB.NET code in ASP.NET Web Page
Message
General information
Forum:
ASP.NET
Category:
Other
Title:
Using ToString in VB.NET code in ASP.NET Web Page
Environment versions
Environment:
ASP.NET
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01435079
Message ID:
01435079
Views:
119
Why is it that this works with the numerical value of the variable BMI (without the ToString), as well as BMI.ToString ? See below near bottom for lblBMI.Text.
Partial Class BMICalculator
    Inherits System.Web.UI.Page

    Protected Sub CalculateBMI_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CalculateBMI.Click
        ' Find out the person's height and weight
        Dim UsersHeight As Integer = txtHeight.Text
        Dim UsersWeight As Integer = txtWeight.Text

        ' Calculate the person's BMI.
        Dim BMI As Decimal
        BMI = (UsersWeight / (UsersHeight * UsersHeight)) * 703

        ' Output the BMI value.
        lblBMI.Text = "Your BMI is " & BMI.ToString
    End Sub
End Class
Next
Reply
Map
View

Click here to load this message in the networking platform