3
Answers

Add different values to one textbox

Photo of mike Delvotti

mike Delvotti

13y
1.1k
1
I'm trying to add multiple values and total them in one textbox from different button clicks. For example I have textBox1 and 5 labels + 5 buttons. I want to be able to click button one and it adds the value from label1 to textBox1 then if I click button2 it will add the value from label2 to textBox1.

I can get it to work once but when I try to add more totals to textbox1 from different buttons it clears the total? what the best way of doing this function? 

Answers (3)

0
Photo of Abie Jose
NA 17 39.3k 13y
Using a Query string you can pass values of current page's control to another page


Response.Redirect("SecondPage.aspx?value1="& Textbox1.text &" &value2 = "& Textbox2.text &" ")


and in the secondpage.aspx you can retrieve this value with the following code

request.querystring("Value1")