Calendar and Archive links causing error

Topics: ASP.NET 2.0
Dec 18, 2007 at 10:04 PM
This isn't happening under the provided themes, just my own for some reason. I have copied the controls from the other themes and copied the code for the controls from my theme into the other themes and there is no correlation to the error and the controls I am using. I'm currious to see if anyone else that may be using their own theme or a modified theme is experiencing this issue. It seemed to have started between change set 8501 and change set 8650 (I skipped the rest).

The problem happens when you click on the dates in the calendar or on the months in the archive list as both links use URIs like /default.sapx/2007/12/14/ or /default.aspx/2007/12/ or even if you enter the URL manually.

The error I get is:

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

The stack trace is:
[ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length]
System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) +2916097
BlogEngine.Core.Web.Controls.PageSiteMap.FindSiteMapNode(String rawUrl) +131
System.Web.SiteMapProvider.FindSiteMapNode(HttpContext context) +49
System.Web.SiteMapProvider.get_CurrentNode() +32
System.Web.SiteMapProvider.GetCurrentNodeAndHintAncestorNodes(Int32 upLevel) +14
System.Web.UI.WebControls.SiteMapPath.CreateControlHierarchy() +53
System.Web.UI.WebControls.SiteMapPath.CreateChildControls() +29
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +50
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2041

I don't have any special code behind on my site.master, SidePanel or on the PostView control. I have breadcrumbs and a menu control that uses the CSS friendly control adapters but even when I remove those from the site.master thinking it is trying to reference something for either of these navigation controls I still have the error.

I'm not saying the fault lies in the blogengine but if someone has any ideas to what might be causing this it would be great.
Dec 18, 2007 at 11:37 PM
After working on this on and off throughout the day, swapping controls in and out of my site.master file I have come down to my menu and breadcrumbs being the problem. Both use the PageSiteMap sitemapprovider. Something in this provider is now broken.