Input string was not in a correct format"异常 的解决方法

BigTypeId = int.Parse(DropDownList1.SelectedValue);

抛出错误:Input string was not in a correct format。

只要检查一下里面的值就OK
int.TryParse(DropDownList1.SelectedValue, out BigTypeId);

你可能感兴趣的:(Input string was not in a correct format"异常 的解决方法)