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 25:                     if (url[i].TrimEnd('/').ToLower() == "components")
Line 26:                     {
Line 27:                         _componentID = Data.Field.RetrieveID("tblComponent", "ComponentID", "FolderName='" + url[i + 1].TrimEnd('/') + "'")[0];
Line 28:                     }
Line 29:                 }

Source File: d:\Sites\assistedsolutions.com\App_Code\ComponentPage.cs    Line: 27

Stack Trace:


[IndexOutOfRangeException: Index was outside the bounds of the array.]
   ComponentPage.get_ComponentID() in d:\Sites\assistedsolutions.com\App_Code\ComponentPage.cs:27
   component_master.Page_Load(Object sender, EventArgs e) in d:\Sites\assistedsolutions.com\components\component.Master.cs:38
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +48
   System.Web.UI.Control.OnLoad(EventArgs e) +133
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2604


Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433