Share via


PasswordRecovery.UserNameInstructionText 속성

정의

사용자가 사용자 이름을 입력할 수 있도록 지침을 제공하기 위해 PasswordRecovery 컨트롤의 사용자 이름 뷰에 표시되는 텍스트를 가져오거나 설정합니다.

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

속성 값

String

사용자 이름 뷰에 표시되는 지침 텍스트입니다. 기본값은 "Enter your user name to receive your password."입니다.

예제

다음 코드 예제에서는 UserNameInstructionText 속성을 "웹 사이트 사용자 이름을 입력 합니다."

<%@ 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>

설명

합니다 UserNameInstructionText 속성은 사용자에 게 사용 하는 방법을 설명 하기 위해 사용자 이름 뷰에 표시 됩니다는 PasswordRecovery 제어 합니다.

스타일 설정을 합니다 InstructionTextStyle 속성에 있는 텍스트의 모양을 정의 합니다 UserNameInstructionText 속성입니다.

에 할당 된 템플릿을 사용 하는 경우는 UserNameTemplate 속성을 UserNameInstructionText 속성이 표시 되지 않습니다.

속성에 대 한 기본 텍스트는 서버의 로캘 설정에 따라 지역화 됩니다.

이 속성의 값으로 설정 된 경우 디자이너 도구를 사용 하 여 리소스 파일에 자동으로 저장 될 수 있습니다. 자세한 내용은 LocalizableAttribute 하 고 전역화 및 지역화합니다.

적용 대상

추가 정보