PasswordRecovery.SubmitButtonStyle Propriedade

Definição

Obtém uma referência a uma coleção de propriedades que definem a aparência dos botões Enviar no controle PasswordRecovery.Gets a reference to a collection of properties that define the appearance of Submit buttons in the PasswordRecovery control.

public:
 property System::Web::UI::WebControls::Style ^ SubmitButtonStyle { System::Web::UI::WebControls::Style ^ get(); };
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public System.Web.UI.WebControls.Style SubmitButtonStyle { get; }
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
member this.SubmitButtonStyle : System.Web.UI.WebControls.Style
Public ReadOnly Property SubmitButtonStyle As Style

Valor da propriedade

Style

Uma referência ao Style que contém propriedades que definem a aparência dos botões de envio.A reference to the Style that contains properties that define the appearance of the Submit buttons.

Atributos

Exemplos

O exemplo de código a seguir mostra o efeito de definir SubmitButtonStyle Propriedades nos diferentes tipos de botões de envio no PasswordRecovery controle.The following code example shows the effect of setting SubmitButtonStyle properties on the different types of Submit buttons in the PasswordRecovery control.

<%@ page language="C#"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
  void DropDownList1_SelectedIndexChanged(object Sender, EventArgs e)
  {
    if (DropDownList1.SelectedValue == "Button")
    {
      PasswordRecovery1.SubmitButtonType = ButtonType.Button;
      // <Snippet4>
      PasswordRecovery1.SubmitButtonText = "Enter User Name";
      // </Snippet4>
    }
  
    if (DropDownList1.SelectedValue == "Image")
    {
      PasswordRecovery1.SubmitButtonType = ButtonType.Image;
      // <Snippet3>
      PasswordRecovery1.SubmitButtonImageUrl = "userNameSubmit.png";
      // </Snippet3>
      PasswordRecovery1.SubmitButtonText = "Enter User Name Image";
    }
  
    if (DropDownList1.SelectedValue == "Link")
    {
      PasswordRecovery1.SubmitButtonType = ButtonType.Link;
      PasswordRecovery1.SubmitButtonText = "Enter User Name";
    }
  }
  
</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>
<%@ 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
      ' <Snippet4>
      PasswordRecovery1.SubmitButtonText = "Enter User Name"
      ' </Snippet4>
    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>

Comentários

A SubmitButtonStyle propriedade define a aparência dos botões de envio no PasswordRecovery controle.The SubmitButtonStyle property defines the appearance of Submit buttons in the PasswordRecovery control. Esta propriedade é somente leitura; no entanto, você pode definir as propriedades do Style objeto retornado.This property is read-only; however, you can set the properties of the Style object it returns. Você pode definir essas propriedades de forma declarativa no formulário Property-Subproperty , em que Subproperty representa uma propriedade da Style classe (por exemplo, SubmitButtonStyle-ForeColor ).You can set these properties declaratively in the form Property-Subproperty, where Subproperty represents a property of the Style class (for example, SubmitButtonStyle-ForeColor). Você também pode definir as propriedades programaticamente no formulário Property.Subproperty (por exemplo, SubmitButtonStyle.ForeColor ).You can also set the properties programmatically in the form Property.Subproperty (for example, SubmitButtonStyle.ForeColor).

As configurações comuns incluem cor de plano de fundo personalizada, cor do texto e propriedades da fonte.Common settings include custom background color, text color, and font properties.

As configurações de estilo da SubmitButtonStyle propriedade são mescladas com as configurações de estilo para o PasswordRecovery controle.The style settings for the SubmitButtonStyle property are merged with the style settings for the PasswordRecovery control. As configurações feitas na SubmitButtonStyle propriedade substituem as configurações correspondentes nas propriedades do PasswordRecovery controle.Any settings made in the SubmitButtonStyle property override the corresponding settings in properties of the PasswordRecovery control.

As propriedades a seguir PasswordRecovery são substituídas pelas SubmitButtonStyle configurações:The following PasswordRecovery properties are overridden by SubmitButtonStyle settings:

Quando você usa modelos para definir a aparência da exibição inicial ou de pergunta do PasswordRecovery controle, a SubmitButtonStyle propriedade não tem nenhum efeito.When you use templates to define the appearance of the initial or Question view of the PasswordRecovery control, the SubmitButtonStyle property has no effect.

Aplica-se a

Confira também