Server Error in '/' Application.

Index was outside the bounds of the array.

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.IndexOutOfRangeException: Index was outside the bounds of the array.

Source Error:


Line 215:                Dim temp As String = ""
Line 216:                If (InStr(oldpath, "-hc")) Then
Line 217:                    temp = "/list.aspx?CategoryID=" & Replace(link(4), ".aspx", "") & "&selection=" & selection & "&cat=" & Replace(link(0), "/", "") & "&subcat=" & link(3) & "&inurl=" & oldpath & referid
Line 218:                Else
Line 219:                    temp = "/list.aspx?CategoryID=" & Replace(link(2), ".aspx", "") & "&selection=" & selection & "&cat=" & link(1) & "&subcat=" & subcat(1) & "&inurl=" & oldpath & referid

Source File: C:\webroot\cloud.shayanashop.com\global.asax    Line: 217

Stack Trace:


[IndexOutOfRangeException: Index was outside the bounds of the array.]
   System.Array.InternalGetReference(Void* elemRef, Int32 rank, Int32* pIndices) +0
   System.Array.GetValue(Int32 index) +78
   Microsoft.VisualBasic.CompilerServices.Container.GetArrayValue(Object[] Indices) +162
   Microsoft.VisualBasic.CompilerServices.NewLateBinding.InternalLateIndexGet(Object Instance, Object[] Arguments, String[] ArgumentNames, Boolean ReportErrors, ResolutionFailure& Failure, Boolean[] CopyBack) +240
   Microsoft.VisualBasic.CompilerServices.NewLateBinding.ObjectLateInvokeDefault(Object Instance, Object[] Arguments, String[] ArgumentNames, Boolean ReportErrors, Boolean[] CopyBack) +123
   Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateIndexGet(Object Instance, Object[] Arguments, String[] ArgumentNames) +85
   ASP.global_asax.Application_BeginRequest(Object sender, EventArgs e) in C:\webroot\cloud.shayanashop.com\global.asax:217
   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.4087.0