Customizing the Appearance of ASP.NET Login Controls
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 include additional controls and command buttons in login control templates as well as replace the default controls and command buttons with your own.
Replacing Command Buttons in a Login Control Template
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.
Replacing Controls in a Login Control Template
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.
Referencing a Control in a Login Control Template
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.
For example, if you were to include a DropDownList control with an ID of TimeZoneList in the ContentTemplate template of the CreateUserStep step of a CreateUserWizard control, you can reference the DropDownList control by calling the FindControl method of the ContentTemplateContainer container of the CreateUserStep property, as shown in the following example.