Hi,
I'm trying to convert the value of a selected item in a dropdown list from a string to an integer. All the values are numbers but i get errors when trying to convert them into int data types.
I have tried the following code:
(int)listCountry.SelectedItem.Value
the compiler raises an error saying that it cannot convert string to int.
I have also tried:
Convert.ToInt32(listCountry.Selecteditem.Value)
but this returns an unhandled error message at runtime.
I need the value in an Int type... Any ideas?
Cheers, James.
I'm trying to convert the value of a selected item in a dropdown list from a string to an integer. All the values are numbers but i get errors when trying to convert them into int data types.
I have tried the following code:
(int)listCountry.SelectedItem.Value
the compiler raises an error saying that it cannot convert string to int.
I have also tried:
Convert.ToInt32(listCountry.Selecteditem.Value)
but this returns an unhandled error message at runtime.
I need the value in an Int type... Any ideas?
Cheers, James.