Frage

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

War es hilfreich?

Lösung

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);
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top