Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hi...

how to create a simple calculator using +,-,*,/ ,clear,dot ,10 buttons and single textbox alone in C#.net web application...


Thanks
Posted
Updated 24-Feb-11 0:44am
v2
Comments
Nish Nishant 24-Feb-11 0:54am    
If this is for a class project/assignment, I'd recommend not doing it. It's too trivial and will not really get you good grades.

If you want to do this as an exercise to help you learn, then well this is rather ironic :-)
Abhinav S 24-Feb-11 6:53am    
Homework!

Search Google for "JavaScript Calculator" and you will get lots of examples.

Okay, let me add some more details:
You need to add buttons for the numbers, dot and operators and a TextBox for showing the result.
For calculation there are two options - Using JavaScript to do it on the client side and other is posting the value to the server and calculating it there. The latter option is not at all recommended. Usually data is posted only when some server side interaction is needed. In this case JavaScript will do everything and server interaction is not at all needed.

Try doing it and get back in case you don't understand something.

Hope that helps!
 
Share this answer
 
v2
Comments
Prerak Patel 24-Feb-11 1:13am    
Good answer, sorry I misunderstood it first. +5
Ankur\m/ 24-Feb-11 1:14am    
Thanks!
I was just going to suggest you to remove your answer because that will remove the vote too. :)
Prerak Patel 24-Feb-11 1:19am    
I just removed it as it was no way relevant. I completely misunderstood the question.
Ankur\m/ 24-Feb-11 1:21am    
Ah it's okay. No worries, it happens sometime. :)
Here is mine, full source code: http://www.sakryukov.org/freeware/calculator/[^].

—SA
 
Share this answer
 
Comments
Yusuf 24-Feb-11 7:17am    
Excellent!
Sergey Alexandrovich Kryukov 24-Feb-11 13:33pm    
Thank you.
--SA
Pravin Patil, Mumbai 24-Feb-11 7:50am    
Brilliant...
Take my 5....
Sergey Alexandrovich Kryukov 24-Feb-11 13:34pm    
Thank you (can be a bit better, I started to improve, did not finish...)
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900