I'm trying to write an asp.net page that will keep variables using the .value command. It's not working. Here's my code

Dim custID As Integer
        Dim noMovies As Integer
        Dim price As Double
        Dim discount As Double
        Dim total As Double

            custID = Integer.Parse(Me.idTextBox.Text)
            noMovies = Integer.Parse(Me.numMovTextBox.Text)
            price = noMovies * RENTAL_RATE
            discount = price * DISCOUNT_RATE
            total = price - discount

        totSales += 1
        'totSalesHiddenField.value = totSales.ToString()    couldn't get this working for the life of me
        totIncome += total

            priceTextBox.Text = price.ToString("C")
            discountTextBox.Text = discount.ToString("C")
            totDueTextBox.Text = total.ToString("C")

            totSalesTextBox.Text = totSales
            totRevTextBox.Text = totIncome.ToString("C")

I keep getting errors that .value is not part of string, decimal, integer, etc

10 Years
Discussion Span
Last Post by SheSaidImaPregy

well for one, make sure whatever you are doing it has a runat=server tag on it.

It should work, make sure it is on a runat="server" tag and form.


your input type="hidden" field should read as below, exactly.

<input type="hidden" id="'totSalesHiddenField" name="'totSalesHiddenField" value="" runat="server">

You need the runat="server" to be able to edit it via the VB you displayed above.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.