Really silly question (but still I need some help) [Resolved]
I have a TextBox called userAge. Assuming the user enters 40 in the textbox, how do I convert the string "40" into a number? I tried (int)userAge.Text but that of course fails.
What am I missing here?
Actually got it
Int32.Parse(userAge.Text) does the trick.
Re: Really silly question (but still I need some help) [Resolved]
Quote:
Originally Posted by VBGuy
I have a TextBox called userAge. Assuming the user enters 40 in the textbox, how do I convert the string "40" into a number? I tried (int)userAge.Text but that of course fails.
What am I missing here?
Actually got it
Int32.Parse(userAge.Text) does the trick.
if your datatype is int then I think you should just use int.Parse()