This documentation is archived and is not being maintained.

PasswordRecovery.SubmitButtonType Property

Gets or sets the type of Submit button to use when rendering the PasswordRecovery control.

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

public virtual ButtonType SubmitButtonType { get; set; }
/** @property */
public ButtonType get_SubmitButtonType ()

/** @property */
public void set_SubmitButtonType (ButtonType value)

public function get SubmitButtonType () : ButtonType

public function set SubmitButtonType (value : ButtonType)

Not applicable.

Property Value

One of the ButtonType values. The default is Button.

Exception typeCondition

ArgumentOutOfRangeException

The SubmitButtonType property is not set to a valid System.Web.UI.WebControls.ButtonType value.

The SubmitButtonType property determines what kind of button is used to submit entries to the PasswordRecovery control.

The following table lists the button type used for each value of the SubmitButtonType property.

SubmitButtonType value

Button used

Button

A standard HTML button. The SubmitButtonText property provides the text for the button.

Image

The image at the location stored in the SubmitButtonImageUrl property. The SubmitButtonText property provides the alternate text for the image.

Link

An HTML link. The SubmitButtonText property provides the link text.

When you use templates to define the appearance of the PasswordRecovery control, the SubmitButtonType property has no effect.

The following code example shows the appearance of the Submit buttons on the PasswordRecovery control for different settings of the SubmitButtonType property.

<%@ 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;
      PasswordRecovery1.SubmitButtonText = "Enter User Name";
    }
  
    if (DropDownList1.SelectedValue == "Image")
    {
      PasswordRecovery1.SubmitButtonType = ButtonType.Image;
      PasswordRecovery1.SubmitButtonImageUrl = "userNameSubmit.png";
      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>

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0
Show: