質問

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