Вопрос

Getting the following error when clicking a link in an application, 'Input string was not in a correct format'.Tried changing things around several times but no luck so this my last resort.

Heres the line of code that brings up the error

Это было полезно?

Решение

Problem is Request[UrlParameters.UrlParameterName.ComplianceActionRisk] is not of type int. So, instead of using Parse, use TryParse which will convert the value to int if its compatible otherwise default value -1 will be used -

int ComplianceAction = -1;
Int32.TryParse(Request[UrlParameters.UrlParameterName.ComplianceActionRisk],
                       out ComplianceAction);
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top