You can customize the contents of several ASP.NET login controls by specifying control templates and adding your own controls to the user interface (UI) of the control, or by replacing or removing optional controls not required for the UI of the control.
You can also use the style properties of login controls as well as themes and skins to tailor the appearance of the control. For more information, refer to the members of the specific control and ASP.NET Themes and Skins.
You can customize the content of any login control where the existing control UI can be replaced using a template. This includes the Login, PasswordRecovery, CreateUserWizard, and ChangePassword controls. The following table lists the templates that are available to customize with each control.
You can use any control as a command button in a login control template. However, for the login control to recognize the command, the command control must bubble up an event that includes event arguments that inherit from the CommandEventArgs class. The command button must specify a value for the CommandName property of the CommandEventArgs class that identifies which command is to be executed by the login control. The following table lists the valid values for the CommandName property and their related login control templates.
You can replace the input and display controls used by several ASP.NET login controls in their respective templates. Each template has controls that must be included in the template as well as optional controls. Required and optional controls are identified using the ID property of the control. If a template does not include a control where the ID property is set to a required control identifier, or if that control does not implement the appropriate interface, the ASP.NET login control will throw an exception.
The following table lists the templates and the required controls by their ID properties.
UserName - The account name of the user to be logged in. This control is required and must implement the IEditableTextControl interface.
Password - The password of the user to be logged in. This control is required and must implement the IEditableTextControl interface.
RememberMe - true to store the authentication token in a persistent cookie; false to store the authentication token in a session cookie. This control is optional and must implement the ICheckBoxControl interface.
FailureText - Displays a login failure message. This control is optional and must implement the ITextControl interface.
To reference a control in a login control template, you can call the FindControl method of the container for the control template. The following table lists the templates and their associated container properties.