Wednesday, March 7, 2012

SharePoint 2010 Anonoymous Access and List Web Part with Custom XSLT

A SharePoint 2010 Site with Anonymous Access has a List Web Part or any web part that has custom XSLT applied, Anonymous user will get access denied. It will work fine for logged on user.


I have a SharePoint 2010 public site and it has Anonymous Access enabled.
On the Landing page I added a List Web Part based on the custom list I created to store announcement information or Ads information. So its a "Landing Page Ads" list.

I added a Landing Page Ads list web part on the page, assigned the custom xslt url in the Miscellaneous section under XSL Link i.e. /Anything/Anything.xsl

After assigning the custom xsl link, this web part is supposed to display list items in a rotating fashion or like a carousel. It works find for the logged on user but for anonymous user it won't work, displays access denied message for that web part. Rest of the content/web parts on the page will display with no problem.

The solution which works in my case: I edited the landing page in SharePoint Designer.

After "< /datafields >" add these tags "< xsl >< /xsl >" and copy the code from Anything.xsl and paste it between "< xsl >< /xsl >"

Save the file and check your landing page with Anonymous access, it should work fine and should not display Access Denied error.