c# - Converting Dropdown list to int -
Hello friends I'm trying to store value in an integer from the dropdown list but I have an exception input string Not in the correct format.
Int experience Years = Convert.ToInt32 ("DropDownList1.SelectedValue"); Please help.
remove quotation marks; The code that stands is trying to convert an integer into the literal string "DropDownList1.SelectedValue" , which can not do it.
int experienceYears = Convert.ToInt32 (DropDownList1.SelectedValue);
Comments
Post a Comment