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 55: 								{
Line 56:                                     currentPage = Components.Page.RootPage.ChildPages.FirstOrDefault(p => p.Name.ToUpper().Equals(CMSUrlDecode(sPathNames[i]).ToUpper()));
Line 57:                                     HttpContext.Current.Response.Write((currentPage == null).ToString() + " : " + Components.Page.RootPage.ChildPagesActive.Count() + " : " + sPathNames[i] + Components.Page.RootPage.ChildPagesActive[3].Name);
Line 58:                                     HttpContext.Current.Response.End();
Line 59: 

Source File: d:\web\tailormade-horses.com\wwwroot\App_Code\QueryPath.cs    Line: 57

Stack Trace:


[IndexOutOfRangeException: Index was outside the bounds of the array.]
   QueryPath.getPathItems() in d:\web\tailormade-horses.com\wwwroot\App_Code\QueryPath.cs:57
   QueryPath.get_PathItems() in d:\web\tailormade-horses.com\wwwroot\App_Code\QueryPath.cs:19
   _Default.Page_PreInit(Object sender, EventArgs e) in d:\web\tailormade-horses.com\wwwroot\Default.aspx.cs:56
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +85
   System.Web.UI.Page.OnPreInit(EventArgs e) +109
   System.Web.UI.Page.PerformPreInit() +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1132


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