LayoutTemplate Property

Login::LayoutTemplate Property

Gets or sets the template used to display the Login control.

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

virtual property ITemplate^ LayoutTemplate {
	ITemplate^ get ();
	void set (ITemplate^ value);

Property Value

Type: System.Web.UI::ITemplate
An ITemplate that contains the template for displaying the Login control. The default value is nullptr.

The LayoutTemplate property contains the template that defines how the Login control is displayed to the user.

The following table lists the required and optional controls used in a Login control template.

ID or command name

Control type



Any control that implements IEditableTextControl, including TextBox, or a custom or third-party control.



Any control that implements IEditableTextControl, including TextBox, or a custom or third-party control.






Any control that implements ITextControl.



Any control that causes event bubbling.


The Login control throws an HttpException exception if the layout template does not contain the required controls. No exception is thrown if you give an optional control ID to a control of the wrong type; however, the control is subsequently ignored by the Login control.

The login control can be any control that causes event bubbling, such as Button, LinkButton, or ImageButton. The control's command name property must be set to "Login".

When a template is used for the Login control, only the following properties affect the behavior of the control:

All other properties are inactive when a template is set for the Login control.

The following code example creates a template for the Login control.

Security noteSecurity Note

This example contains 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.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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

Community Additions

© 2016 Microsoft