开发者

How to detect the view mode (PersonalizationScope) of a SharePoint WebPart

How do I check programmatically whether a web part is displa开发者_运维技巧yed in the shared resp. in personal mode.


The PersonalizationScope can be accessed like this:

public class MyWebPart: WebPart 
{
  protected override void OnLoad(EventArgs e)
  {
    base.OnLoad(e);
    if (WebPartManager.Personalization.Scope == PersonalizationScope.Shared)
    {
      // Do something
    }
  } 
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜