Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using ToString in VB.NET code in ASP.NET Web Page
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Using ToString in VB.NET code in ASP.NET Web Page
Versions des environnements
Environment:
ASP.NET
Database:
Visual FoxPro
Divers
Thread ID:
01435079
Message ID:
01435079
Vues:
118
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform