MOSS中判断当前页面是否Browser状态是否Share状态

 bool flag = false;
                SPWebPartManager currentWebPartManager = (SPWebPartManager) WebPartManager.GetCurrentWebPartManager(this.Page);
                if ((currentWebPartManager != null) && (currentWebPartManager.DisplayMode == WebPartManager.BrowseDisplayMode))
                {
                    PageView view = SPWeb.PageViewFromUri(this.Context.Request.Url, this.Context);
                    if ((view != PageView.Shared) && (view != PageView.Personal))
                    {
                        if (currentWebPartManager.HasPersonalizedParts)
                        {
                            flag = true;
                        }
                    }
                    else
                    {
                        flag = true;
                    }

                 }

posted @ 2008-08-25 14:40  彷徨......  阅读(291)  评论(0编辑  收藏  举报