如何从沙箱解决方案Sharepoint 2010中的Web部件获取数据

时间:2012-06-03 11:02:32

标签: sharepoint web-parts

我想使用sharepoint工作流从Web部件获取数据以填充列表项数据。如何使用沙盒解决方案解决此问题? 我发现如何使用服务器场解决方案,而不是沙箱:

using (SPSite site = new SPSite(""))
{
using (SPWeb web = site.OpenWeb())
{
SPFile file = web.GetFile("default.aspx");   
SPLimitedWebPartManager lwpm = file.GetLimitedWebPartManager(PersonalizationScope.Shared);                                   SPLimitedWebPartCollection webParts = lwpm.WebParts;
System.Web.UI.WebControls.WebParts.WebPart wp = webParts[1];                    
string content = (((Microsoft.SharePoint.WebPartPages.ContentEditorWebPart)(wp)).Content).InnerText;                
}  
}

0 个答案:

没有答案