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 40:                 UrlHelper urlHelper = new UrlHelper();
Line 41: 
Line 42:                 int urunID = id.ToInt32();
Line 43:                 var urun = db.UrunVaryantlari.FirstOrDefault(x => x.UrunVaryantID == urunID);
Line 44: 

Source File: c:\Web Sites\vanitysale.com\App_Code\Global.cs    Line: 42

Stack Trace:


[FormatException: Input string was not in a correct format.]
   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +14784004
   System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +172
   System.Convert.ToInt32(String value) +60
   SGShop.Base.ExtensionMethods.extString.ToInt32(String str) in C:\SG Data\Projects\My Projects\SGShop\SGShop.Base\ExtensionMethods\extString.cs:107
   Global.Application_BeginRequest(Object sender, EventArgs e) in c:\Web Sites\vanitysale.com\App_Code\Global.cs:42
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +139
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +88


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