I have a web application that needs to pull data from a Sharepoint list and display it with the same "look and feel" as a sharepoint list, but on a different web site.
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.spgridview.aspx
The web application is not installed on a server with the SharePoint foundation. The sharepoint DLLs were naturally missing, but I have copied them from the server where SP is installed and added them to my project. The page compiles now, but it's throwing an exception which appears whenever I insert the SPGridView ASP element.
The exception is: System.ArgumentException: Absolute path information is required.
Stack trace:
[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
If I remove the SPGridView ASP element, the page runs. Does anyone know how to get this to work? I know I can use the Client Object Model, but AFAIK it doesn't provide anything to show lists with the same appearance and functionality as in Sharepoint.
The simplest way to phantom host SharePoint content on a web page (i.e. show SharePoint content on a page hosted on a non-SharePoint server) is the classic and trusty old IFrame. Here's the steps:
That should do it.