-
Newbie question, C #
Hi.
Sorry for my bad english. But I was wondering if someome could help me out with an issue with C #. I want to make two textboxes where I can type two numbers. Then press a button and they wil be added togheter. When I make this, something happens wrong. Do I have to convert textboxes to int? How to?
ex:
5
+
5
= 55
I want it to be 5+5=10
And I also have one more question. If I make a question, (with dropdownlist and a button that says "Next". When pressing this button I want a new question to appear. How to make a new "site" with a new question?
Thanks for any answers.
Mate :)
-
Hello, it's better to post this question in the C # subforum.
-
Moved to C# Programming forum.
-
Code:
int res = 0;
Int32.TryParse(this.textBox1.Text, out res);
-
Wrong:
"5" + "5" = "55"
Right:
5 + 5 = 10
The problem you're having is you are adding two strings together, or rather you're joining two strings together.