Please Guys
I want to add every value i enter in a textbox continuously. But i always get result once.
say i enter :
10+10=20
20+30=50
50+5=55.....
With every value i enter in the textbox adding to the result.
In fact it work well in windows Forms but not working well in mvc and web forms.
See the code Below
- int Total = 0;
- int Adxer;
- protected void Button1_Click(object sender, EventArgs e)
- {
- int Amount = Convert.ToInt32(TextBox1.Text);
- Adxer = Total - Amount;
- Total = Adxer;
- Label1.Text = Total.ToString();
- }
- MVC Code
- public ActionResult OscarProRe( int Amount=0)
- {
- if(btn != null)
- {
- int addy = Amount;
- int Total;
- Total = userB + addy;
- userB = Total;
- ViewBag.To = userB;
- }
- }
Please in mvc the value does not add to the result.
Help me find out where i got it wrong
Any answer is Warmly welcome. Thanks