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 74:         List<tbNewsDATA> listnew = tbNewsDB.tbNews_GetByID(nid);
Line 75:         //listnew = listnew.Where(s => s.newLang == lang).ToList();
Line 76:         List<tbGroupNewsDATA> glst = tbGroupNewsDB.tbGroupNews_GetByID(listnew[0].grnID);
Line 77:         int n = glst[0].grnLevel.Length / 5;
Line 78:         for (int i = 0; i < n; i++)

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

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.News() in d:\Hosting\huongqueonline.com\www\cms\news\u_Nav_Content.ascx.cs:76
   cms_news_u_Nav_Content.Nav_Content() in d:\Hosting\huongqueonline.com\www\cms\news\u_Nav_Content.ascx.cs:62
   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