Server Error in '/' Application.

Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

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: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Source Error:


Line 104:        List<tbCategoryDATA> glst = tbCategoryDB.tbCategory_GetByID(catid);
Line 105:        //glst = glst.Where(s => s.catLang == lang).ToList();
Line 106:        int n = glst[0].catlevel.Length / 5;
Line 107:        for (int i = 0; i < n; i++)
Line 108:        {

Source File: d:\Hosting\huongqueonline.com\www\cms\news\u_Nav_Content.ascx.cs    Line: 106

Stack Trace:


[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
   System.ThrowHelper.ThrowArgumentOutOfRangeException() +78
   System.Collections.Generic.List`1.get_Item(Int32 index) +53
   cms_news_u_Nav_Content.Product() in d:\Hosting\huongqueonline.com\www\cms\news\u_Nav_Content.ascx.cs:106
   cms_news_u_Nav_Content.Nav_Content() in d:\Hosting\huongqueonline.com\www\cms\news\u_Nav_Content.ascx.cs:64
   cms_news_u_Nav_Content.Page_Load(Object sender, EventArgs e) in d:\Hosting\huongqueonline.com\www\cms\news\u_Nav_Content.ascx.cs:35
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
   System.Web.UI.Control.OnLoad(EventArgs e) +132
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428


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