WebPartZoneBase.AllowLayoutChange Propriedade

Definição

Obtém ou define um valor que indica se o layout dos controles WebPart pode ser alterado dentro de uma zona.Gets or sets a value that indicates whether the layout of WebPart controls can be changed within a zone.

public:
 virtual property bool AllowLayoutChange { bool get(); void set(bool value); };
[System.Web.UI.Themeable(false)]
public virtual bool AllowLayoutChange { get; set; }
[<System.Web.UI.Themeable(false)>]
member this.AllowLayoutChange : bool with get, set
Public Overridable Property AllowLayoutChange As Boolean

Valor da propriedade

Boolean

true Se o layout puder ser alterado; caso contrário, false .true if the layout can be changed; otherwise, false. O padrão é true.The default is true.

Atributos

Exemplos

O exemplo de código a seguir demonstra o uso declarativo da AllowLayoutChange propriedade em um WebPartZone controle.The following code example demonstrates the declarative use of the AllowLayoutChange property on a WebPartZone control. Para o exemplo de código completo, incluindo o arquivo de origem code-behind e a página. aspx que contém a zona nesse código, consulte a WebPartZoneBase visão geral da classe.For the full code example, including the code-behind source file and the .aspx page that contains the zone in this code, see the WebPartZoneBase class overview.

Observe que a AllowLayoutChange propriedade é definida como true , que é o padrão.Notice that the AllowLayoutChange property is set to true, which is the default. Se você alterar o valor para false , depois de carregar a página em um navegador e alternar a página para o modo de exibição de design, você não poderá arrastar controles dentro ou para a WebPartZone2 zona.If you change the value to false, after you load the page into a browser and switch the page into design display mode, you will not be able to drag controls within or into the WebPartZone2 zone.

<asp:WebPartZone 
  ID="WebPartZone2"
  Runat="server" 
  DragHighlightColor="#00ff00"
  AllowLayoutChange="true"
  EmptyZoneText="Add WebParts to this empty Zone."
  BorderWidth="2"
  BorderColor="DarkBlue"
  BorderStyle="Dashed" 
  MenuLabelText="Verbs Menu" 
  MenuPopupImageUrl="label.gif" >
  <VerbStyle Font-Italic="true" />
  <MenuLabelStyle BackColor="Lime" BorderWidth="1"  />
  <MenuLabelHoverStyle Font-Bold="true" />
  <MenuVerbHoverStyle BackColor="LightGrey" />
  <MenuVerbStyle Font-Italic="true" /> 
  <ZoneTemplate>
    <asp:Label ID="Label1" Runat="server" Title="Date" />
  </ZoneTemplate>
</asp:WebPartZone>
<asp:WebPartZone 
  ID="WebPartZone2"
  Runat="server" 
  DragHighlightColor="#00ff00"
  AllowLayoutChange="true"
  EmptyZoneText="Add WebParts to this empty Zone."
  BorderWidth="2"
  BorderColor="DarkBlue"
  BorderStyle="Dashed" 
  MenuLabelText="Verbs Menu" 
  MenuPopupImageUrl="label.gif" >
  <VerbStyle Font-Italic="true" />
  <MenuLabelStyle BackColor="Lime" BorderWidth="1"  />
  <MenuLabelHoverStyle Font-Bold="true" />
  <MenuVerbHoverStyle BackColor="LightGrey" />
  <MenuVerbStyle Font-Italic="true" /> 
  <ZoneTemplate>
    <asp:Label ID="Label1" Runat="server" Title="Date" />
  </ZoneTemplate>
</asp:WebPartZone>

Comentários

A AllowLayoutChange Propriedade entra em vigor somente quando uma zona está em um modo de exibição de página no qual o layout dos controles na zona pode ser alterado, como DesignDisplayMode .The AllowLayoutChange property takes effect only when a zone is in a page display mode in which the layout of controls in the zone can be changed, such as DesignDisplayMode.

Quando AllowLayoutChange é definido como false em uma determinada zona, há várias ações que os usuários finais são impedidos de executar em controles na zona:When AllowLayoutChange is set to false on a given zone, there are a number of actions that end users are prevented from carrying out on controls in the zone:

  • Os usuários não podem arrastar controles para uma zona diferente, reorganizar os controles dentro da zona ou mover controles para a zona.Users cannot drag controls to a different zone, rearrange controls within the zone, or move controls into the zone.

  • Várias propriedades que afetam a interface do usuário dos WebPart controles na zona são desabilitadas para que os usuários não possam editar essas propriedades enquanto o controle está sendo editado usando os AppearanceEditorPart controles e BehaviorEditorPart .A number of properties that affect the user interface (UI) of WebPart controls in the zone are disabled so that users cannot edit those properties while the control is being edited using the AppearanceEditorPart and BehaviorEditorPart controls.

  • Os usuários não podem adicionar novos controles à zona a partir de um CatalogPart controle.Users cannot add new controls to the zone from a CatalogPart control.

  • Os verbos fechar, excluir, minimizar e restaurar não são mostrados nos controles na zona.The close, delete, minimize, and restore verbs are not shown on controls in the zone.

Embora a AllowLayoutChange propriedade afete a capacidade dos usuários finais de alterar o layout de uma zona por meio da interface do usuário, ela não afeta a capacidade de alterar o layout de forma programática.Although the AllowLayoutChange property affects end users' ability to change the layout of a zone through the UI, it does not affect the ability to change the layout programmatically. Por exemplo, se AllowLayoutChange for definido como false , os usuários não poderão fechar os controles na zona, mas um desenvolvedor ainda poderá chamar o CloseWebPart método para fechar os controles programaticamente.For example, if AllowLayoutChange is set to false, users cannot close controls in the zone, but a developer could still call the CloseWebPart method to close controls programmatically.

Esta propriedade não pode ser definida por temas ou temas de folha de estilo.This property cannot be set by themes or style sheet themes. Para obter mais informações, consulte ThemeableAttribute e temas e capas do ASP.net.For more information, see ThemeableAttribute and ASP.NET Themes and Skins.

Aplica-se a

Confira também