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 34:         Dim FirstCharacter2 As Integer = absoluteurl.IndexOf("&nights=")
Line 35: 
Line 36:         Dim strProduto = absoluteurl.Substring(FirstCharacter + 3, (FirstCharacter1 - 1) - FirstCharacter - 2)
Line 37:         Dim strData = absoluteurl.Substring(FirstCharacter1 + 6, (FirstCharacter2 - 1) - FirstCharacter1 - 5)
Line 38:         Dim strNoites As String = 0

Source File: C:\Sites\prod_EMVIAGEM\BookExtPackage.aspx.vb    Line: 36

Stack Trace:


[ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length]
   System.String.Substring(Int32 startIndex, Int32 length) +14599229
   BookExtPackage.BookExtPackage_Load(Object sender, EventArgs e) in C:\Sites\prod_EMVIAGEM\BookExtPackage.aspx.vb:36
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +90
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1533


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