none
Trying to Create a Sitemap webpart RRS feed

  • Question

  • I'm trying to create a sitemap webpart but having a hard time. I'm looping through the web apps and then site collections/subsites but I only want to show site collections/subsites if they have permission to view it.  Meaning it shouldn't show on the sitemap if they get a "Access Denied" when they click on the site.

    Is there any simple examples out there that do this?

    Thanks!

    Tuesday, October 4, 2011 3:12 PM

Answers

  • Hi,

       you can take try catch loop while iterating sitemap.

       if there is access denied at one web then loop will go inside catch  where do nothing ,and then refer next web.

     

     

    Regards,
    Milan Chauhan

    Tuesday, October 4, 2011 3:18 PM
  • Why are you trying to reinvent the wheel?

    What you describe is a normal navigation control with a SiteMapProvider in the backend.

    The SiteMapProviders coming with SharePoint would allow to do the security trimming automatically.

    So you only have to choose a nav control, define the branding through CSS and bind it to one of the SharePoint site map providers and you are done.

    Cheers,
    Stefan


    Stefan Goßner
    Senior Escalation Engineer - Microsoft CSS
    This post is provided "AS IS" with no warrenties and confers no rights.
    • Marked as answer by Shimin Huang Friday, October 14, 2011 7:48 AM
    Tuesday, October 4, 2011 7:03 PM

All replies

  • Hi,

       you can take try catch loop while iterating sitemap.

       if there is access denied at one web then loop will go inside catch  where do nothing ,and then refer next web.

     

     

    Regards,
    Milan Chauhan

    Tuesday, October 4, 2011 3:18 PM
  • Why are you trying to reinvent the wheel?

    What you describe is a normal navigation control with a SiteMapProvider in the backend.

    The SiteMapProviders coming with SharePoint would allow to do the security trimming automatically.

    So you only have to choose a nav control, define the branding through CSS and bind it to one of the SharePoint site map providers and you are done.

    Cheers,
    Stefan


    Stefan Goßner
    Senior Escalation Engineer - Microsoft CSS
    This post is provided "AS IS" with no warrenties and confers no rights.
    • Marked as answer by Shimin Huang Friday, October 14, 2011 7:48 AM
    Tuesday, October 4, 2011 7:03 PM