|
-
May 19th, 2004, 07:13 AM
#1
Thread Starter
Fanatic Member
Did adding, subtracting, etc.. change in asp.net?
Using asp.net (vb) and have a label and textbox.
In vb6 we could do a lblExciseAmt.Text + txtLaborAmt.Text and result in the sum of the two numbers provided in each control.
If I have a value of 1 and 0 respectively I get a result of 10 in asp.net. Is there a new way of doing calculations? Do I have to put into variables first?
Well I got the first issue resolved by adding the CDbl. Now I get an the following error 'Input string was not in a correct format' pointing to the 2nd line.
Code:
lblMLSubTotal.Text = CDbl(txtMaterialAmt.Text) + CDbl(txtLaborAmt.Text)
lblExciseAmt.Text = CDbl(lblMLSubTotal.Text) * CDbl(txtExciseAmt.Text)
Thanks in advance.
Last edited by lleemon; May 19th, 2004 at 07:51 AM.
-
May 19th, 2004, 08:28 AM
#2
Frenzied Member
VB Code:
lblTotal.Text = Double.Parse(txtNum1.Text) + Double.Parse(txtNum2.Text)
lblTotal.Text = Double.Parse(txtNum1.Text) * Double.Parse(txtNum2.Text)
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
-
May 19th, 2004, 10:25 AM
#3
Thread Starter
Fanatic Member
Thanks for the quick response. I have applied this change and am still getting the:
Exception Details: System.FormatException: Input string was not in a correct format
source error pointing to the second line. Is it possible since I am doing this with a label?
Code:
lblMLSubTotal.Text = Double.Parse(txtMaterialAmt.Text) + Double.Parse(txtLaborAmt.Text)
lblExciseAmt.Text = Double.Parse(lblMLSubTotal.Text) * Double.Parse(txtExciseAmt.Text)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|