G
Guest
Hi,
I have a textbox setup on a web form and it suppose to keep a running
total of some other textboxs on page. In code behind I have a global double
var that is suppose to collect the total but doesn't work.
Here's what it looks like:
In global area I have:
protected double RegTot = 0.0;
In Method I have:
RegTot += RegTot + TextBox1.value;
when ever I change TextBox1.value, RegTot is always zero. So I only get the
present value in textbox1 and never any previous values that should be in
RegTot. How should I code this so I can collect the values in Textbox1
multiple times and store in RegTot for a final amount? This is not in a table
or datagrid.
Thanks,
JJ
I have a textbox setup on a web form and it suppose to keep a running
total of some other textboxs on page. In code behind I have a global double
var that is suppose to collect the total but doesn't work.
Here's what it looks like:
In global area I have:
protected double RegTot = 0.0;
In Method I have:
RegTot += RegTot + TextBox1.value;
when ever I change TextBox1.value, RegTot is always zero. So I only get the
present value in textbox1 and never any previous values that should be in
RegTot. How should I code this so I can collect the values in Textbox1
multiple times and store in RegTot for a final amount? This is not in a table
or datagrid.
Thanks,
JJ