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 205:            metaDescription.Name = "description";
Line 206:            if (contentLabel.Text.Length > 255)
Line 207:                metaDescription.Content = util.removeCrLfTab(util.StripHTML(contentLabel.Text).Substring(0, 255).Trim());
Line 208:            else
Line 209:                metaDescription.Content = util.removeCrLfTab(util.StripHTML(contentLabel.Text)).Trim();

Source File: C:\inetpub\StrategyPageRoot\htmw\htmw.aspx.cs    Line: 207

Stack Trace:


[ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length]
   System.String.Substring(Int32 startIndex, Int32 length) +14342724
   htmw.display() in C:\inetpub\StrategyPageRoot\htmw\htmw.aspx.cs:207
   htmw.OnPreRender(EventArgs e) in C:\inetpub\StrategyPageRoot\htmw\htmw.aspx.cs:35
   System.Web.UI.Control.PreRenderRecursiveInternal() +132
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3671


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