Question

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

Was it helpful?

Solution

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);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top