PasswordRecovery.SubmitButtonStyle Property
Gets a reference to a collection of properties that define the appearance of Submit buttons in the PasswordRecovery control.
Assembly: System.Web (in System.Web.dll)
The SubmitButtonStyle property defines the appearance of Submit buttons in the PasswordRecovery control. This property is read-only; however, you can set the properties of the Style object it returns. You can set these properties declaratively in the form Property-Subproperty, where Subproperty represents a property of the Style class (for example, SubmitButtonStyle-ForeColor). You can also set the properties programmatically in the form Property.Subproperty (for example, SubmitButtonStyle.ForeColor).
Common settings include custom background color, text color, and font properties.
The style settings for the SubmitButtonStyle property are merged with the style settings for the PasswordRecovery control. Any settings made in the SubmitButtonStyle property override the corresponding settings in properties of the PasswordRecovery control.
The following PasswordRecovery properties are overridden by SubmitButtonStyle settings:
When you use templates to define the appearance of the initial or Question view of the PasswordRecovery control, the SubmitButtonStyle property has no effect.
The following code example shows the effect of setting SubmitButtonStyle properties on the different types of Submit buttons in the PasswordRecovery control.
<%@ page language="VB"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) If DropDownList1.SelectedValue = "Button" Then PasswordRecovery1.SubmitButtonType = ButtonType.Button PasswordRecovery1.SubmitButtonText = "Enter User Name" End If If DropDownList1.SelectedValue = "Image" Then PasswordRecovery1.SubmitButtonType = ButtonType.Image ' <Snippet3> --> PasswordRecovery1.SubmitButtonImageUrl = "userNameSubmit.png" ' </Snippet3> --> PasswordRecovery1.SubmitButtonText = "Enter User Name Image" End If If DropDownList1.SelectedValue = "Link" Then PasswordRecovery1.SubmitButtonType = ButtonType.Link PasswordRecovery1.SubmitButtonText = "Enter User Name" End If End Sub </script> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>ASP.NET Example</title> </head> <body> <form id="Form1" runat="server"> <table border="1"> <tbody> <tr> <td> <asp:passwordrecovery id="PasswordRecovery1" runat="server" submitbuttonimageurl="userNameSubmit.png" submitbuttontext="Enter User Name"> <submitbuttonstyle font-names="Comic Sans MS" forecolor="White" backcolor="#00C000"> </submitbuttonstyle> </asp:passwordrecovery> </td> <td align="center"> Choose a button type:<br /> <asp:dropdownlist id="DropDownList1" runat="server" onselectedindexchanged="DropDownList1_SelectedIndexChanged" autopostback="true"> <asp:listitem value="Button">Button</asp:listitem> <asp:listitem value="Image">Image</asp:listitem> <asp:listitem value="Link">Link</asp:listitem> </asp:dropdownlist> </td> </tr> </tbody> </table> </form> </body> </html>
Available since 2.0