Server Error in '/' Application.

Length cannot be less than zero.
Parameter name: length

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.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length

Source Error:


Line 62:         {
Line 63:             strProduct = Request.QueryString["product"].ToString();
Line 64:             strProductIDValue = strProduct.Substring(0, strProduct.IndexOf("-"));
Line 65:             strProductIDValue = strProductIDValue.Substring(2, strProductIDValue.Length - 2);
Line 66: 

Source File: c:\inetpub\vhosts\supremeayurveda.com\httpdocs\product.aspx.cs    Line: 64

Stack Trace:


[ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length]
   System.String.Substring(Int32 startIndex, Int32 length) +13220367
   _Default.GetQueryStringData() in c:\inetpub\vhosts\supremeayurveda.com\httpdocs\product.aspx.cs:64
   _Default.Page_Load(Object sender, EventArgs e) in c:\inetpub\vhosts\supremeayurveda.com\httpdocs\product.aspx.cs:26
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
   System.Web.UI.Control.OnLoad(EventArgs e) +95
   System.Web.UI.Control.LoadRecursive() +59
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +678


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