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

Source File: C:\inetpub\StrategyPageRoot\qnd\qnd.aspx.cs    Line: 206

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
   qnd_qnd.display() in C:\inetpub\StrategyPageRoot\qnd\qnd.aspx.cs:206
   qnd_qnd.OnPreRender(EventArgs e) in C:\inetpub\StrategyPageRoot\qnd\qnd.aspx.cs:31
   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