PasswordLabelText Property

Login.PasswordLabelText Property


Gets or sets the text of the label for the Password text box.

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

public virtual string PasswordLabelText { get; set; }

Property Value

Type: System.String

The text of the label for the Password text box. The default is "Password:".

The PasswordLabelText property contains the label text for the Password text box.

The TextLayout property defines where the field label is positioned.

The default text for the control is localized based on the server's current locale.

The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see LocalizableAttribute and ASP.NET Globalization and Localization.

The following code example sets the PasswordLabelText property to "User Password:".

<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<script runat="server">
void Page_Load(object sender, EventArgs e) 
    Login1.UserNameLabelText = "User ID:";
    Login1.PasswordLabelText = "User Password:";

<html xmlns="" >
    <head runat="server">
    <title>ASP.NET Example</title>
        <form id="form1" runat="server">
            <asp:Login id="Login1" runat="server" 
                UserNameLabelText="User ID:" 
                PasswordLabelText="User Password:">


.NET Framework
Available since 2.0
Return to top
© 2015 Microsoft