Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
LoginButtonImageUrl Property

Login.LoginButtonImageUrl Property

Gets or sets the URL of an image to use for the login button.

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

public virtual string LoginButtonImageUrl { get; set; }
/** @property */
public String get_LoginButtonImageUrl ()

/** @property */
public void set_LoginButtonImageUrl (String value)

public function get LoginButtonImageUrl () : String

public function set LoginButtonImageUrl (value : String)

Not applicable.

Property Value

The URL of the image used for the login button. The default is Empty.

The LoginButtonImageUrl property contains the URL of the image rendered as the Login control login button when the LoginButtonType property is set to Image.

The LoginButtonText property is used as the alternative text for the image in browsers that do not display images.

The following code example sets the LoginButtonImageUrl property to the URL of an image.

<%@ 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 ChangeClick(object sender, EventArgs e)
{
    if (Login1.LoginButtonType == ButtonType.Image)
    {
        Login1.LoginButtonImageUrl = String.Empty;
        Login1.LoginButtonType = ButtonType.Button;
    }
    else
    {
        Login1.LoginButtonImageUrl = "images/login.png";
        Login1.LoginButtonType = ButtonType.Image;
    }
}
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
    <form id="form1" runat="server">
      <table>
        <tr>
          <td>
            <asp:Login id="Login1" 
                       runat="server" 
                       LoginButtonImageUrl="images/login.png" 
                       LoginButtonText="Submit the login form."
                       LoginButtonType="Image">
            </asp:Login>
          </td>
          <td>
            <asp:Button id="change" 
                        runat="server" 
                        Text="Change Login button." 
                        onClick="ChangeClick">
            </asp:Button>
          </td>
        </tr>
      </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

Community Additions

ADD
Show:
© 2015 Microsoft