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

Forums / Deployment / Sitemap wrong URL on production server

Sitemap wrong URL on production server

2 posts, 1 answered
  1. Roy
    Roy avatar
    28 posts
    Registered:
    20 Jan 2009
    02 Mar 2010
    Link to this post
    Hello, 

    During development of our website the site was hosted on a subdirectory of our testserver. After moving the site to the production server I noticed that the sitemap I created doesn't work.

    On the production server the URL for the home page is formatted as "www.mydomainname.nl/~/home.aspx"
    How can I remove the "~" sign?

    The contents of my webusercontrol is:

    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <telerik:RadSiteMap ID="RadSiteMap1" runat="server" DataSourceID="dsSiteMap" ShowNodeLines="true">
        <LevelSettings>
            <telerik:SiteMapLevelSetting Level="0">
                <NodeTemplate>
                    <a href='<%# DataBinder.Eval(Container.DataItem, "Url") %>' class="node0">
                        <%# DataBinder.Eval(Container.DataItem, "title") %>
                    </a>
                </NodeTemplate>
            </telerik:SiteMapLevelSetting>
            <telerik:SiteMapLevelSetting Level="1" Layout="Flow" >
                <NodeTemplate>
                    <div>
                        <a href='<%# DataBinder.Eval(Container.DataItem, "Url") %>' class="node1">
                            <%# DataBinder.Eval(Container.DataItem, "title") %>
                        </a>
                    </div>
                </NodeTemplate>
            </telerik:SiteMapLevelSetting>
        </LevelSettings>
    </telerik:RadSiteMap>
    <asp:SiteMapDataSource ID="dsSiteMap"   ShowStartingNode="false" runat="server" SiteMapProvider="CmsSiteMapProvider" />

    Kind regards,

    Roy

  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    10 Mar 2010
    Link to this post
    Hi Roy,

    Apologies for the late reply. 

    The problem is that the URLs in the sitemap are not resolved. This means that you are assigning unresolved urls to the link directly. Please change the template as follows:

    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <telerik:RadSiteMap ID="RadSiteMap1" runat="server" DataSourceID="dsSiteMap" ShowNodeLines="true">
        <LevelSettings>
            <telerik:SiteMapLevelSetting Level="0">
                <NodeTemplate>
                    <a href='<%# ResolveUrl(DataBinder.Eval(Container.DataItem, "Url").ToString()) %>' class="node0">
                        <%# DataBinder.Eval(Container.DataItem, "title") %>
                    </a>
                </NodeTemplate>
            </telerik:SiteMapLevelSetting>
            <telerik:SiteMapLevelSetting Level="1" Layout="Flow" >
                <NodeTemplate>
                    <div>
                        <a href='<%# ResolveUrl(DataBinder.Eval(Container.DataItem, "Url").ToString()) %>' class="node1">
                            <%# DataBinder.Eval(Container.DataItem, "title") %>
                        </a>
                    </div>
                </NodeTemplate>
            </telerik:SiteMapLevelSetting>
        </LevelSettings>
    </telerik:RadSiteMap>
    <asp:SiteMapDataSource ID="dsSiteMap"   ShowStartingNode="false" runat="server" SiteMapProvider="CmsSiteMapProvider" />

    This should fix the links. 

    Kind regards,
    Georgi
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
    Answered
2 posts, 1 answered