Export (0) Print
Expand All

PasswordRecovery::UserName Property

Gets or sets the text that appears in the User Name text box.

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

public:
virtual property String^ UserName {
	String^ get ();
	void set (String^ value);
}
<asp:PasswordRecovery UserName="String" />

Property Value

Type: System::String
The user name entered by the user. The default value is Empty.

The UserName property contains the user name entered by the user, or Empty if the user has not entered a name. The UserName property is used only in the UserName view.

The UserName property is saved in the PasswordRecovery control's control state to preserve the values between round trips to the server even when view state is turned off for the page. PasswordRecovery control properties represented by text boxes, such as UserName, are accessible during all phases of the page life cycle. The control will pick up any changes made by the end user by means of the TextChanged event triggered by the textboxes.

The style settings in the TextBoxStyle property define the appearance of the text in the UserName property.

When you assign a template to the UserName property to display the UserName view, the UserName property is assigned the value entered in a required TextBox control with the ID property set to "UserName".

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 changes the UserName property for a specific membership provider.

Security noteSecurity Note

This example contains a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see Script Exploits Overview.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2014 Microsoft