+1-888-365-2779
Try Now
More in this section

Forums / 3.x Pre-release forums (retired) / Cannot use a leading .. to exit above the top directory.

Cannot use a leading .. to exit above the top directory.

10 posts, 0 answered
  1. fregas baratis
    fregas baratis avatar
    185 posts
    Registered:
    14 Nov 2002
    26 Feb 2007
    Link to this post
    I keep getting this error when I add certain types of controls into my master page.  First, i tried to add a user control that displays rotating images using hyperlink and image controls.  I was able to avoid the error by ensuring there was no reference to relative paths such as "~/somedir/file.aspx".  Instead, i made the reference just "/somedir/file.aspx"  However, now just I tried to add the sitemappath control to my master page and I keep getting this error when i go to child pages.

    Cannot use a leading .. to exit above the top directory.

    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.Web.HttpException: Cannot use a leading .. to exit above the top directory.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [HttpException (0x80004005): Cannot use a leading .. to exit above the top directory.]
    System.Web.Util.UrlPath.ReduceVirtualPath(String path) +3536158
    System.Web.Util.UrlPath.Reduce(String path) +84
    System.Web.Util.UrlPath.Combine(String appPath, String basepath, String relative) +355
    System.Web.HttpResponse.ApplyAppPathModifier(String virtualPath) +208
    System.Web.UI.WebControls.SiteMapPath.InitializeItem(SiteMapNodeItem item) +761
    System.Web.UI.WebControls.SiteMapPath.CreateItem(Int32 itemIndex, SiteMapNodeItemType itemType, SiteMapNode node) +111
    System.Web.UI.WebControls.SiteMapPath.CreateControlHierarchyRecursive(Int32& index, SiteMapNode node, Int32 parentLevels) +66
    System.Web.UI.WebControls.SiteMapPath.CreateControlHierarchy() +93
    System.Web.UI.WebControls.SiteMapPath.CreateChildControls() +29
    System.Web.UI.Control.EnsureChildControls() +87
    System.Web.UI.WebControls.CompositeControl.get_Controls() +12
    Telerik.Cms.Web.CmsHelper.FindContentPlaceHolders(Control control, List`1 list) +99
    Telerik.Cms.Web.CmsHelper.FindContentPlaceHolders(Control control, List`1 list) +160
    Telerik.Cms.Web.CmsHelper.FindContentPlaceHolders(Control control, List`1 list) +160
    Telerik.Cms.Web.InternalPage.CreateChildControls() +1357
    System.Web.UI.Control.EnsureChildControls() +87
    System.Web.UI.Control.PreRenderRecursiveInternal() +41
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360


    Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
  2. Bob
    Bob avatar
    330 posts
    Registered:
    24 Sep 2012
    26 Feb 2007
    Link to this post
    Hello Craig,

    You should not use SiteMapPath control. Because of the way it resolves paths, it cannot work with Sitefinity. Use the Telerik.Web.UI.Breadcrumb control instead. The correct way to specify paths is like this "~/somedir/file.aspx".

    Can you tell us how to reproduce the problems you have with URLs specified with leading "~/"?

    Greetings,
    Bob
    the telerik team
  3. fregas baratis
    fregas baratis avatar
    185 posts
    Registered:
    14 Nov 2002
    26 Feb 2007
    Link to this post
    ok, i used a breadcrumb control and it worked fine except that the first node is "Root Node" instead of our Home page.  I was able to work around this by handling the ItemCreated event and chaning the title and url of the very first node, but i was wondering if there was a better way to do this and tell sitefinity that the home page should be considered the root or first node.  Anyway, not a big deal.

    As far as the URL thing, its pretty easy for me to reproduce.  I had some hyperlinks in a user control.  The hyperlinks has relative paths on their ImageUrl property such as "~/somesection/somepage.aspx" and then i placed that user control in the master page directly (not using sitefinity) and then i would get this error.  However, once i change the urls to /somesection/somepage.aspx it works fine.


  4. fregas baratis
    fregas baratis avatar
    185 posts
    Registered:
    14 Nov 2002
    26 Feb 2007
    Link to this post
    Also, when i use the breadcrumb control, it does not display on any of my non-navigable pages.  Its like non-navigable pages do not exist.

    I tried doing this in the web.config:
    <add name="AllPages" navigable="false" type="Telerik.Cms.Web.CmsSiteMapProvider"/>

    and then this in the breadcrumb:
     <radM:breadcrumb runat="server" ID="BreadCrumb" SiteMapProvider="AllPages" ShowStartingNode="true"></radM:breadcrumb>

    but it still doesnt show up
  5. Bob
    Bob avatar
    330 posts
    Registered:
    24 Sep 2012
    27 Feb 2007
    Link to this post
    Hi Craig,

    Indeed, the Hyperlink control does not resolve the ImagerUrl property correctly. Thank you for pointing this out. We will fix it for the next release.

    The page hierarchy in Sitefinity starts from a root node that is not actual page. That’s why by default the property ShowStartingNode in the Breadcrumb control is set to false. This way the path will always start from a page that is at the first level. If I understand correctly, you want the first node always to be the home page which usually is at the first level too. There are two ways to achieve this. The way you do it or to build the page hierarchy in such a way so the home page is the only one at the first level.

    I could not reproduce the behavior you describe in the other post. I set the Breadcrumb and the site map provider exactly as you describe and everything works just as expected. Note that this will work only with the latest update. It will not work with previous versions.

    If the problem persists, please send us a project reproducing it.

    Kind regards,
    Bob
    the telerik team
  6. fregas baratis
    fregas baratis avatar
    185 posts
    Registered:
    14 Nov 2002
    27 Feb 2007
    Link to this post
    ok, the root node thing should be fine.  I just wanted to make sure i was doing it correctly.

    As far as the breadcrumbs issue is concerned, i was able to recreate this issue in a new sitefinity project.  I created some new pages, made one of them hidden, made other pages below them and the breadcrumbs do not show up when i browse to those pages. 

    Should i email that project and if so where to?

    Thanks,
    Craig
  7. Rebecca
    Rebecca avatar
    536 posts
    Registered:
    24 Sep 2012
    27 Feb 2007
    Link to this post
    Hi Craig,

    Please go to My Support Tickets section and open a new support ticket. Zip and send us your running project demonstrating the issue together with your project dataabse.

    Looking forward to your reply,
    Rebecca
    the telerik team
  8. Bob
    Bob avatar
    330 posts
    Registered:
    24 Sep 2012
    27 Feb 2007
    Link to this post
    Hello Craig,

    The project you sent us is from RC1 the first release. The Breadcrumb control will work correctly with non navigable pages only with the hotfix for RC1. Please uninstall Sitefinity, delete all folders below \Program Files\telerik\Sitefinity3.0 except WebSites folder and install the updated version. You can download the updated version from this link: http://www.sitefinity.com/support/forums/support-forum-thread/b1043S-tcbhb.aspx.

    The version number should be 3.0.1068.3.

    Greetings,
    Bob
    the telerik team
  9. fregas baratis
    fregas baratis avatar
    185 posts
    Registered:
    14 Nov 2002
    27 Feb 2007
    Link to this post
    Ok thanks!  I'll try that.
  10. fregas baratis
    fregas baratis avatar
    185 posts
    Registered:
    14 Nov 2002
    27 Feb 2007
    Link to this post
    I upgraded my site to the newer RC1 that you send me.  That fixed my issue with the breadcrumbs, however now all my content has disappeared.  Its still in the database and shows up in the admin, but no longer shows up on the front end of the site.
Register for webinar
10 posts, 0 answered