Issues with sitemaps

7 posts, 0 answers
  1. Peter
    Peter avatar
    9 posts
    Member since:
    Dec 2010

    Posted 12 Jan 2012 Link to this post

    Hi there,

    Im currently using the RadPanelBar and RadMenu as navigation on my website. They are both using the same datasource (see sitemap). For the radMenu I want to be able to click on the administrator/broker manager node and have it take me to the default page for that section. I thought I could just put the default.aspx url in the upper node, but I realised that all the urls have to be unique.At the moment, clicking on either the Administration or Broker Manager nodes takes the user to a directory listing. Is there a way around this? I have attached pictures to better explain what Im doing.

    Thanks for your time!

    Peter


    <?xml version="1.0" encoding="utf-8" ?>
        <siteMapNode url="/Views/" title=""  description="">
            <siteMapNode url="/Views/BrokerManager/" title="Broker Manager">
                <siteMapNode url="/Views/BrokerManager/BrokerManager/" title="Broker Manager">
                    <siteMapNode url="/Views/BrokerManager/BrokerManager/Default.aspx" title="Brokers" />
                    <siteMapNode url="/Views/BrokerManager/BrokerManager/OfficeList.aspx" title="Offices" />
                </siteMapNode>
            </siteMapNode>
            <siteMapNode url="/Views/Administration/" title="Adminstration" >
                <siteMapNode url="/Views/Administration/UserManagement/" title="User Management" description="">
                    <siteMapNode url="/Views/Administration/UserManagement/Default.aspx" title="Users" />
                    <siteMapNode url="/Views/Administration/UserManagement/Roles.aspx" title="Roles" />
                </siteMapNode>
                <siteMapNode url="/Views/Administration/Subscribers/" title="Subscriber Management" description="">
                    <siteMapNode url="/Views/Administration/Subscribers/Default.aspx" title="Subscribers" />
                </siteMapNode>
            </siteMapNode>
        </siteMapNode>
    </siteMap
  2. Peter
    Peter avatar
    9 posts
    Member since:
    Dec 2010

    Posted 17 Jan 2012 Link to this post

    Hit there,

    Its been 5 days since I've posted this, could someone please respond to this post?

    Thanks
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 17 Jan 2012 Link to this post

    Hello Peter,

    Indeed the .NET Framework requires URL's to be unique because behind the scenes it stores SiteMapNodes in a Dictionary object in memory. However, you can get around this requirement by appending parameters to your URLs (e.g. Default.aspx?1, and Default.aspx?2)

    All the best,
    Kate
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  5. Peter
    Peter avatar
    9 posts
    Member since:
    Dec 2010

    Posted 17 Jan 2012 Link to this post

    Hi Kate,

    Thanks for your response! Although this technique works, the RadPanel on the left interprets this as being on the upper node (see NewBroker.jpg). I realise Panel is behaving the way it should, I was just hoping there was some way of getting it to display the node of my choice (as .rpSelected) without resorting to a redirect. Is it perhaps possible to achieve this through some jigging in the code behind?
  6. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 19 Jan 2012 Link to this post

    Hi Peter,

    There are two approaches that I could come up with - the first one is to apply a CssClass property on ItemDataBound that will apply the .rpSelected class:
    protected void RadPanelBar1_ItemDataBound(object sender, Telerik.Web.UI.RadPanelBarEventArgs e)
            {
                SiteMapNode node1 = (SiteMapNode)e.Item.DataItem;          
                e.Item.CssClass = node1["CssClass"];
            }

    The second one is to use the PersistStateInCookie property as demonstrated in our online demo.

    Greetings,
    Kate
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  7. Jacques
    Jacques avatar
    135 posts
    Member since:
    Jun 2007

    Posted 19 Jan 2012 Link to this post

    Hi Kate,

    I'm not sure we're on the same page here. I want to try and explain this again perhaps it will help.

    If you look at Peter's attached images you will notice 2 primary menu items 1) Broker Manager and 2) Administration. You will also see the secondary/tertiary navigation on the left side below the page title. I say secondary and tertiary, because that's how it's represented, but in this case the secondary portion, or nodes, are just groupings for the tertiary menus. In other words they will never be pages themselves. What we need is the following:
    1. When you click on Broker Manager the site should redirect to the tertiary menu Brokers
    2. The brokers menu should be highlighted by default
    3. The secondary navigation items (or the grouping panels) should never have any form of highlighting applied because they're just groupings.

    In the past we have managed to get around this by creating a sitemap and multiple URLs and perhaps differentiating duplicate URLs by adding query strings to them. The problem in this case is that the panel, or grouping bar, seems to be behaving like a default whereby if the Broker tertiary menu does not Exactly match the given URL then the panel grouping bar becomes active.

    Perhaps the panel bar is not the optimal choice? I can't see how the panel bar was meant to work if it can't do this... or is it a case that the Panel bar is just not suited to menus?

    Regards,
    Jacques
  8. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 21 Jan 2012 Link to this post

    Hi Jacques,

    As far as I can understand from your post you need that none of the RadPanelItems (on the left side ex:Brokers, Offices) to be highlighted at all. If this is the case, my previously suggested approach could be helpful though I am not completely sure that I understand the entire logic of your application.  Refer to the attached project that demonstrates the suggested approach with applying the CssClass property to the desired items. In this example I use RadPanelBar that I bind to a SiteMapDataSource and assign a CssClass property to every item. In your case, you can assign a CssClass and add the necessary properties only to the desired items (the ones with text Brokers and Offices). Of course in the implementation of these css classes you will need to get the correct css class selector so that you can remove the highlighting style.

    Another approach (very similar to the one mentioned above) could be to remove the highlighting style using the appropriate css class selector , using the Office2007 skin, this would be:

    div.RadPanelBar_Office2007 .rpGroup a.rpLink,
     div.RadPanelBar_Office2007 .rpGroup .rpOut {
          background-image: none;
    }

    Greetings,
    Kate
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017