Server Error in '/' Application.

Input string was not in a correct format.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.FormatException: Input string was not in a correct format.

Source Error:


Line 12:     if (Global.OriginalUrlWithoutQueryString.Contains("/prodotti/"))
Line 13:     {
Line 14:         currentProd = EEDataHelper.LoadFromTable("Prodotti", int.Parse(Global.OriginalUrlWithoutQueryString
Line 15: .Split("-/".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).Last()));
Line 16:     }

Source File: c:\deployments\DNS4E\www.valtermoto2022.com\templates\www.valtermoto2022.com\_Layout.cshtml    Line: 14

Stack Trace:


[FormatException: Input string was not in a correct format.]
   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +14524616
   System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +172
   ASP._Page_templates_www_valtermoto2022_com__Layout_cshtml.Execute() in c:\deployments\DNS4E\www.valtermoto2022.com\templates\www.valtermoto2022.com\_Layout.cshtml:14
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) +99
   System.Web.WebPages.WebPage.ExecutePageHierarchy() +182
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +122
   System.Web.WebPages.<>c__DisplayClass40_0.<RenderPageCore>b__0(TextWriter writer) +309
   System.Web.WebPages.WebPageBase.Write(HelperResult result) +108
   System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) +89
   System.Web.WebPages.WebPageBase.PopContext() +310
   System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContextBase httpContext) +142


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3770.0