Length cannot be less than zero.<br>Parameter name: length

Server Error in '/' Application.

Length cannot be less than zero.
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: Length cannot be less than zero.
Parameter name: length

Source Error:


Line 527:                                    else
Line 528:                                    {
Line 529:                                        string imagepath = path.Substring(0, path.Length - 5);
Line 530:                                        int position = imagepath.IndexOf("/", 1);
Line 531:                                        imagepath = imagepath.Substring(position);

Source File: c:\Inetpub\WebManager\MarkHay\2.80.1446\CMSWebParts\Text\editableimage.ascx.cs    Line: 529

Stack Trace:


[ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length]
   System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) +9381723
   System.String.Substring(Int32 startIndex, Int32 length) +11
   CMSWebParts_Text_editableimage.LoadContent(String content, Boolean forceReload) in c:\Inetpub\WebManager\MarkHay\2.80.1446\CMSWebParts\Text\editableimage.ascx.cs:529
   CMSWebParts_Text_editableimage.LoadContent(PageInfo pageInfo, Boolean forceReload) in c:\Inetpub\WebManager\MarkHay\2.80.1446\CMSWebParts\Text\editableimage.ascx.cs:476
   CMS.PortalControls.CMSAbstractEditableWebPart.LoadContent(PageInfo pageInfo) +15
   CMS.PortalControls.CMSPagePlaceholder.LoadRegionsContent() +123
   CMS.PortalControls.CMSPagePlaceholder.LoadRegionsContent() +299
   CMS.PortalControls.CMSPagePlaceholder.LoadRegionsContent() +299
   CMS.PortalControls.CMSPagePlaceholder.OnLoad(EventArgs e) +34
   System.Web.UI.Control.LoadRecursive() +120
   System.Web.UI.Control.LoadRecursive() +190
   System.Web.UI.Control.LoadRecursive() +190
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3954


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