1

我有一个 Web 应用程序需要从 Sharepoint 列表中提取数据并以与 Sharepoint 列表相同的“外观”显示它,但在不同的网站上。

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.spgridview.aspx

Web 应用程序安装在具有 SharePoint 基础的服务器上。sharepoint DLL 自然丢失了,但我已从安装 SP 的服务器复制它们并将它们添加到我的项目中。该页面现在可以编译,但它会抛出一个异常,每当我插入 SPGridView ASP 元素时就会出现该异常。

例外情况是:System.ArgumentException:需要绝对路径信息。

堆栈跟踪:

[ArgumentException: Absolute path information is required.]
   System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath) +12658807
   System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList) +112
   Microsoft.SharePoint.Utilities.SPUtility.ComputeFileHash(String filePath) +470
   Microsoft.SharePoint.Utilities.SPUtility.MakeBrowserCacheSafeLayoutsUrl(String name, Boolean localizable) +487
   Microsoft.SharePoint.WebControls.ScriptLinkInfo.ToScriptUrl(Page page) +488
   Microsoft.SharePoint.WebControls.ScriptLinkInfo.ToScriptBlock(Page page) +24
   Microsoft.SharePoint.WebControls.ScriptLink.RegisterForControl(Control ctrl, Page page, String name, Boolean localizable, Boolean defer, Boolean loadAfterUI, String language) +1195
   Microsoft.SharePoint.WebControls.ScriptLink.Register(Page page, String name, Boolean localizable, Boolean defer, String language, String uiVersion) +38
   Microsoft.SharePoint.WebControls.ScriptLink.Register(String uiVersion, Page page, String name, Boolean localizable, Boolean defer) +59
   Microsoft.SharePoint.WebControls.ScriptLink.Register(Page page, String name, Boolean localizable) +30
   Microsoft.SharePoint.WebControls.SPGridView.OnLoad(EventArgs args) +86
   System.Web.UI.Control.LoadRecursive() +71
   System.Web.UI.Control.LoadRecursive() +190
   System.Web.UI.Control.LoadRecursive() +190
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3064

如果我删除 SPGridView ASP 元素,页面就会运行。有谁知道如何让它工作?我知道我可以使用客户端对象模型,但是 AFAIK 它没有提供任何东西来显示具有与 Sharepoint 中相同的外观和功能的列表。

4

0 回答 0