Databinding and Security Trimming

2 posts, 0 answers
  1. Brian Goldman
    Brian Goldman avatar
    34 posts
    Member since:
    Mar 2005

    Posted 20 Jul 2010 Link to this post

    Hello,
    I'm trying to use the panel bar for a site navigation and still be able to use custom attributes to specify properties for the panel bar such as ImageURL, HoverImageURL, etc but still have security trimming.
    My first attempt was with a site map provider but I can't define custom attributes in the web.sitemap file.
    Then I tried an xml file and then security trimming didn't work.

    Is there anyway to use something other than the sitemapprovider and still have security trimming.

    Thanks,
    Brian
  2. Brian Goldman
    Brian Goldman avatar
    34 posts
    Member since:
    Mar 2005

    Posted 21 Jul 2010 Link to this post

    Well after several hours of trial and error and searching I think I have it. In case someone else needs this, here is what I did.

    In your web.sitemap file you would add the attribute for example for the expanded setting
    <siteMapNode title="Settings"  description="Global Settings" roles="Administrator" expanded="true">


    then in your code you would add this:
    protected void RadPanelBar1_ItemDataBound(object sender, Telerik.Web.UI.RadPanelBarEventArgs e)
           {
             e.Item.Expanded = Boolean.Parse(((System.Web.SiteMapNode)e.Item.DataItem)["expanded"]);
              
           }

    It's just that simple.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top