I've been practicing with asp.net web forms and controls and have now become a bit stuck on the best way to work with numeric data in user input forms for instance a simple example would be a input field called 'length' and one called width the user clicks a button and the result of L * W is calculated and display.
I have tested converting strings to int using Convert.ToInt32(strvalue2); and out-putting the results to the Console ok.
But when i try and convert them and output them to a form control using something like this:
string strvaluel = length.Text;
string strvalueW = width.Text;
int numValuel = Convert.ToInt32(strvaluel);
int numValueW = Convert.ToInt32(strvalueW);
outputbox.Text = numValuel * numValueW; (error cannot explicitly convert type 'int' to 'string'
I'm very new to asp.net so any help would be appreciated
int.TryParse()to convert a string to an integer when the string is user supplied, so that you can gracefully handle the case where they enter a non-integer value.