ListView::LayoutTemplate Property
Gets or sets the custom content for the root container in a ListView control.
Assembly: System.Web.Extensions (in System.Web.Extensions.dll)
[BrowsableAttribute(false)] [PersistenceModeAttribute(PersistenceMode::InnerProperty)] [TemplateContainerAttribute(typeof(ListView))] public: virtual property ITemplate^ LayoutTemplate { ITemplate^ get (); void set (ITemplate^ value); }
<asp:ListView> <LayoutTemplate>ITemplate</LayoutTemplate> </asp:ListView>
Property Value
Type: System.Web.UI::ITemplateAn object that contains the custom content for the root container in a ListView control. The default is nullptr, which indicates that this property is not set.
Use the LayoutTemplate property to define a custom user interface (UI) for the root container of the ListView control. The LayoutTemplate template is required by the ListView control.
To specify the layout template, add a LayoutTemplate element inside the ListView control. You can then add the contents of the template to the LayoutTemplate element.
The LayoutTemplate content must include a placeholder control such as a table row (tr) element for the items that are defined by the ItemTemplate template or for groups that are defined by the GroupTemplate template. The placeholder control must have the runat attribute set to "server" and the ID attribute set to the value of the ItemPlaceholderID or the GroupPlaceholderID property, depending on whether the ListView control is using groups.
The following example shows how to define a custom template for the root container in the ListView control.
Security Note: |
|---|
This example has a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see Script Exploits Overview. |
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Security Note: