Sitecore 5.0 API

State.CurrentLayoutChanged Property

NOTE: This property is now obsolete.

Use State.CustomLayout instead


Gets or sets a boolean that indicates if current layout was changed.

[Visual Basic]
Public Shared Property CurrentLayoutChanged As Boolean
[C#]
public static bool CurrentLayoutChanged {get; set;}

Property Value

True, if the layout has been changed, otherwise false.

Remarks

This boolean is used with with the State variable CurrentLayout. When CurrentLayout is programatically set, CurrentLayoutChanged is set to true.

The scope of the value is page and it is stored in the Items variable "SC_CURRENT_LAYOUT_CHANGED".

Example

The following example builds a special layout if the user is a special user.

  public void BuildVIPLayout(string user) {
    if (user == "VIP") {
      State.CurrentLayout = "VIP layout";
      State.AddRenderings.Add("VIPRendering");
    }
  }
  
  public void Build() {
    bool changed = State.CurrentLayoutChanged; // false
    BuildVIPLayout("Employee");
    changed = State.CurrentLayoutChanged; // false
    BuildVIPLayout("VIP");
    changed = State.CurrentLayoutChanged; // true
  }

See Also

State Class | Sitecore.Configuration Namespace | CurrentLayout