Sitecore 5.1.1 API

State.RemoveRenderings Property

Gets a has array list of renderings that should be removed from the list of default renderings.

[Visual Basic]
Public Shared ReadOnly Property RemoveRenderings As ArrayList
[C#]
public static System.Collections.ArrayList RemoveRenderings {get;}

Property Value

An array list of rendering names or IDs.

Remarks

Default renderings are the renderings specified as part of the current layout. For instance the Home layout may have a Document rendering.

When builing a programatic layout using AddRenderings and DisableDefaultRenderings, it is possible to remove default renderings.

Example

The following code adds the SpotBox rendering to the page, and removes the Document rendering, if the user is logged into the extranet.

  public PersonalizePage() {
    if (ExtranetSecurity.IsLoggedIn) {
      State.AddRenderings.Add("SpotBox");
      State.RemoveRenderings.Add("Document");
    }
  }

See Also

State Class | Sitecore.Configuration Namespace