Export (0) Print
Expand All

PasswordRecovery.UserNameInstructionText Property

Gets or sets the text to display in the UserName view of the PasswordRecovery control to instruct the user to enter a user name.

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

[LocalizableAttribute(true)] 
public virtual string UserNameInstructionText { get; set; }
/** @property */
public String get_UserNameInstructionText ()

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

public function get UserNameInstructionText () : String

public function set UserNameInstructionText (value : String)

Not applicable.

Property Value

The instruction text to display in the UserName view. The default is "Enter your user name to receive your password."

The UserNameInstructionText property is displayed in the UserName view to explain to the user how to use the PasswordRecovery control.

The style settings in the InstructionTextStyle property define the appearance of the text in the UserNameInstructionText property.

When using a template assigned to the UserNameTemplate property, the UserNameInstructionText property is not displayed.

The default text for the property is localized based on the server's locale setting.

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 UserNameInstructionText property to "Enter your Web site user name."

<%@ 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 PasswordRecovery1_UserLookupError(object sender, EventArgs e)
  {
    PasswordRecovery1.UserNameInstructionText = "Enter the correct Web site user name.";
    PasswordRecovery1.InstructionTextStyle.ForeColor = System.Drawing.Color.Red;
  }
  
  void PasswordRecovery1_AnswerLookupError(object sender, EventArgs e)
  {
    PasswordRecovery1.QuestionInstructionText = "Enter the correct answer to this question.";
    PasswordRecovery1.InstructionTextStyle.ForeColor = System.Drawing.Color.Red;
  }
  
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
  <asp:passwordrecovery id="PasswordRecovery1" runat="server" 
    questioninstructiontext="Enter the answer to the password confirmation question."
    usernameinstructiontext="Enter your Web site user name." 
    OnUserLookupError="PasswordRecovery1_UserLookupError" OnAnswerLookupError="PasswordRecovery1_AnswerLookupError">
    <instructiontextstyle 
      font-size="Smaller" 
      font-names="Comic Sans MS" 
      font-italic="True" 
      forecolor="Blue">
    </instructiontextstyle>
  </asp:passwordrecovery>
</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