Other sites lack this functionality as does SharePoint Foundation. However, the code to do the hiding is simple:
public void HideRibbonForAnon() { SPRibbon current = SPRibbon.GetCurrent(this.Page); if (current != null && !this.Page.Request.IsAuthenticated) { current.CommandUIVisible = false; SiteActions actions = SiteActions.GetCurrent(this.Page); if (actions != null) { actions.Visible = false; } HideStatusBar(); } }
internal void HideStatusBar() { string script = "document.onreadystatechange=fnRemoveAllStatus; function fnRemoveAllStatus(){removeAllStatus(true)};"; this.Page.ClientScript.RegisterClientScriptBlock(typeof(HideTheRibbon), "statusBarRemover", script, true); }
No comments:
Post a Comment