PasswordRecovery.UserNameInstructionText Propriedade

Definição

Obtém ou define o texto a ser exibido na exibição UserName do controle PasswordRecovery para instruir o usuário a inserir um nome de usuário.Gets or sets the text to display in the UserName view of the PasswordRecovery control to instruct the user to enter a user name.

public:
 virtual property System::String ^ UserNameInstructionText { System::String ^ get(); void set(System::String ^ value); };
public virtual string UserNameInstructionText { get; set; }
member this.UserNameInstructionText : string with get, set
Public Overridable Property UserNameInstructionText As String

Valor da propriedade

String

O texto de instrução a ser exibido na exibição de nome de usuário.The instruction text to display in the UserName view. O padrão é "Insira seu nome de usuário para receber sua senha".The default is "Enter your user name to receive your password."

Exemplos

O exemplo de código a seguir define a UserNameInstructionText propriedade como "Insira seu nome de usuário do site".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">

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

  ' <Snippet2>
  Sub PasswordRecovery1_UserLookupError(ByVal sender As Object, ByVal e As System.EventArgs)
    PasswordRecovery1.UserNameInstructionText = "Enter the correct Web site user name."
    PasswordRecovery1.InstructionTextStyle.ForeColor = System.Drawing.Color.Red
  End Sub
  ' </Snippet2>
  
  ' <Snippet4>
  Sub PasswordRecovery1_AnswerLookupError(ByVal sender As Object, ByVal e As System.EventArgs)
    PasswordRecovery1.QuestionInstructionText = "Enter the correct answer to this question."
    PasswordRecovery1.InstructionTextStyle.ForeColor = System.Drawing.Color.Red
  End Sub
  ' </Snippet4>
</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>

Comentários

A UserNameInstructionText propriedade é exibida na exibição de nome de usuário para explicar ao usuário como usar o PasswordRecovery controle.The UserNameInstructionText property is displayed in the UserName view to explain to the user how to use the PasswordRecovery control.

As configurações de estilo na InstructionTextStyle propriedade definem a aparência do texto na UserNameInstructionText propriedade.The style settings in the InstructionTextStyle property define the appearance of the text in the UserNameInstructionText property.

Ao usar um modelo atribuído à UserNameTemplate propriedade, a UserNameInstructionText propriedade não é exibida.When using a template assigned to the UserNameTemplate property, the UserNameInstructionText property is not displayed.

O texto padrão da propriedade é localizado com base na configuração de localidade do servidor.The default text for the property is localized based on the server's locale setting.

O valor dessa propriedade, quando definido, pode ser salvo automaticamente em um arquivo de recurso usando uma ferramenta de designer.The value of this property, when set, can be saved automatically to a resource file by using a designer tool. Para obter mais informações, consulte, LocalizableAttribute globalização e localização.For more information, see LocalizableAttribute and Globalization and Localization.

Aplica-se a