SharePoint 2010 XsltListViewWebPart - Anonymous users denied access to external xsl file
I'm using XSLTListViewWebPart with external .xsl file:
<xlslink>my.xls</xlslink>
With authorized access everything is ok, but if I try to repeat this anonymously I get an error:
Error while executing web part: System.UnauthorizedAccessException: A开发者_运维知识库ccess is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
at Microsoft.SharePoint.Library.SPRequest.UpdateWebPartCache(String bstrWebUrl, Boolean bAllUsers, String bstrID, Byte[]& ppsaData, Boolean fOMCall)
at Microsoft.SharePoint.WebPartPages.SPWebPartManager.CacheWriteInternal(Guid storageKey, Byte[] cacheData, Storage storage, Boolean omCall)
at Microsoft.SharePoint.WebPartPages.BaseXsltListWebPart.get_CustomizedXsl()
at Microsoft.SharePoint.WebPartPages.BaseXsltListWebPart.LoadXslCompiledTransform(WSSXmlUrlResolver someXmlResolver)
at Microsoft.SharePoint.WebPartPages.DataFormWebPart.GetXslCompiledTransform()
at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform(Boolean bDeferExecuteTransform)
Is this a bug of SharePoint?
it's a SharePoint bug. SharePoint does the transformation once and caches it, its a caching issue. Look at this post for more details:
http://social.technet.microsoft.com/Forums/da-DK/sharepoint2010customization/thread/3d95f279-91c0-47be-b7b9-3a0f83ff4f8c
I was able to get around this by using a DataFormWebPart instead of the ListViewWebPart. The XSLT file can then be used in the same way and there seemed to be no caching-related issue.
精彩评论