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 19:         If Not context.Request("pt") Is Nothing Then PageType = context.Request("pt")
Line 20: 
Line 21:         If Not context.Request("p") Is Nothing Then ProductId = CInt(context.Request("p"))
Line 22: 
Line 23:         If Not context.Request("pc") Is Nothing Then ProductCode = CInt(context.Request("pc"))

Source File: C:\Website\medent.co.nz\www\App_Code\VB\Medent\SearchHelper.vb    Line: 21

Stack Trace:


[FormatException: Input string was not in a correct format.]
   Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String Value, NumberFormatInfo NumberFormat) +213
   Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value) +90

[InvalidCastException: Conversion from string "SUPACKF" to type 'Integer' is not valid.]
   Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value) +238
   SearchHelper..ctor() in C:\Website\medent.co.nz\www\App_Code\VB\Medent\SearchHelper.vb:21
   MedentStore_ProductDetails..ctor() in C:\Website\medent.co.nz\www\medentstore\ProductDetails.aspx.vb:8
   ASP.medentstore_productdetails_aspx..ctor() in C:\Website\medent.co.nz\www\medentstore\ProductDetails.aspx.vb:912304
   __ASP.FastObjectFactory_app_web_s4ni5h3f.Create_ASP_medentstore_productdetails_aspx() +52
   System.Web.Compilation.BuildResultCompiledType.CreateInstance() +31
   System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) +100
   System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +31
   System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +64
   System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +191
   System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +156
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +48
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +159


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