TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Atta Kumah
NA
167
12.2k
Continue Adding Value from TextBox
Jun 18 2020 3:42 PM
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
Reply
Answers (
1
)
How to Pass data from Ajax to Controller method ?
Length of binary number from Excel with C#