Server Error in '/' Application.

Index and length must refer to a location within the string.
Parameter name: length

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 and length must refer to a location within the string.
Parameter name: length

Source Error:


Line 553:
Line 554:                            string chuoicuoi = lines[lines.Length - 1].Trim().ToLower();
Line 555:                            chuoicuoi = chuoicuoi.Substring(0, 2);
Line 556:                            if (chuoicuoi == "bv")
Line 557:                            {

Source File: d:\vhosts\thanhphamland.com\httpdocs\App_Code\VQS.cs    Line: 555

Stack Trace:


[ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length]
   System.String.Substring(Int32 startIndex, Int32 length) +13148947
   TTV.VQS.get_ControlCurent() in d:\vhosts\thanhphamland.com\httpdocs\App_Code\VQS.cs:555
   Site.LoadIcon_SEO() in d:\vhosts\thanhphamland.com\httpdocs\Site.master.cs:149
   Site.LoadModulesControl() in d:\vhosts\thanhphamland.com\httpdocs\Site.master.cs:276
   Site.Page_Load(Object sender, EventArgs e) in d:\vhosts\thanhphamland.com\httpdocs\Site.master.cs:125
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +52
   System.Web.UI.Control.OnLoad(EventArgs e) +97
   System.Web.UI.Control.LoadRecursive() +61
   System.Web.UI.Control.LoadRecursive() +134
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693


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