クライアント オブジェクト モデルを使用して、sharepoint 2010 サイトからリモートでデータにアクセスしようとしています。いくつかの制限により、ユーザー ログインに基づいて適切な対象者をフィルター処理できません (CAML クエリに関して助けていただければ、それも問題ありません:: 取得方法がわかりません)。 CAML/クライアント オブジェクト モデルを使用する現在のユーザー オーディエンス名とすべてのオーディエンス (このコードはモバイル サイトにあり、私のコードに示すように共有ポイント サイトを呼び出します)。この次のコードは正常に機能しますが、Web パーツからコンテンツを取得できません。誰かがこれに関して助けてくれますか。
using (ClientContext ctx = new ClientContext("https://mysite.com/Pages/Default.aspx"))
{
ctx.ExecutingWebRequest += new EventHandler<WebRequestEventArgs> (clientContext_ExecutingWebRequest);
File home=ctx.Web.GetFileByServerRelativeUrl("/Student/Pages/default.aspx");
//get the web part manager
Microsoft.SharePoint.Client.WebParts.LimitedWebPartManager wpm = home.GetLimitedWebPartManager(Microsoft.SharePoint.Client.WebParts.PersonalizationScope.Shared);
IEnumerable<Microsoft.SharePoint.Client.WebParts.WebPartDefinition> wpds = null;
//create the LINQ query to get the web parts from
//the web part definition collection
wpds = ctx.LoadQuery(wpm.WebParts.Include(wp => wp.Id,wp => wp.WebPart));
//load the list of web parts
ctx.ExecuteQuery();
//enumerate the results
foreach (Microsoft.SharePoint.Client.WebParts.WebPartDefinition wpd in wpds)
{
string title= wpd.WebPart.Title;
Microsoft.SharePoint.Client.WebParts.WebPart wpart = wpd.WebPart;
????? How to render and receive the data (looking for the same data When you browse the site with the browser)
}
Code continues...