Export (0) Print
Expand All
Expand Minimize

Wizard.LayoutTemplate Property

Gets or sets the custom content of the root container in a Wizard control.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

[PersistenceModeAttribute(PersistenceMode.InnerProperty)]
[TemplateContainerAttribute(typeof(Wizard))]
[BrowsableAttribute(false)]
public virtual ITemplate LayoutTemplate { get; set; }
<asp:Wizard>
	<LayoutTemplate>ITemplate</LayoutTemplate>
</asp:Wizard>

Property Value

Type: System.Web.UI.ITemplate
An object that contains the custom content for the root container in a Wizard control. The default is null, which indicates that this property is not set.

You can use the LayoutTemplate property to define a custom user interface (UI) for the Wizard control. To specify a layout template, add a LayoutTemplate element inside the Wizard control markup. Inside the LayoutTemplate element, add placeholders for the components of the Wizard control. Placeholders for the navigation, sidebar, and wizard-step sections of the Wizard control are required in the LayoutTemplate element.

NoteNote

You can modify the layout template in Source view. Editing the layout template in Design view is not supported.

The following example shows how to add a LayoutTemplate element to the Wizard control and how to format the components of the Wizard control by using div elements. When the control renders, the div elements will be used instead of HTML tables to format the control.

    <form id="form1" runat="server">
   <asp:Wizard ID="Wizard1" runat="server">
  <LayoutTemplate>
    <div>
      <asp:PlaceHolder ID="headerPlaceHolder" runat="server" />
    </div>
    <div>
      <asp:PlaceHolder ID="navigationPlaceHolder" runat="server" />
    </div>

    <div>
      <asp:PlaceHolder ID="sideBarPlaceHolder" runat="server" />
    </div>

    <div>
      <asp:PlaceHolder ID="WizardStepPlaceHolder" runat="server" />
    </div>
  </LayoutTemplate>

  <SideBarTemplate>
    <asp:ListView ID="sideBarList" runat="server">
      <LayoutTemplate>
        <div id="ItemPlaceHolder" runat="server"/>
      </LayoutTemplate>

      <ItemTemplate>
         <asp:LinkButton ID="sideBarButton" runat="server" 
             Text="Button" />
      </ItemTemplate>

    </asp:ListView>
  </SideBarTemplate>

  <HeaderTemplate>
     Header content.
  </HeaderTemplate>

  <WizardSteps>
    <asp:WizardStep ID="WizardStep1" runat="server" Title="Step 1">
        Step 1 Content.
   </asp:WizardStep>
  <asp:WizardStep ID="WizardStep2" runat="server" Title="Step 2">
        Step 2 Content.
  </asp:WizardStep>
  </WizardSteps>
</asp:Wizard>

    </form>

.NET Framework

Supported in: 4.6, 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft