다음을 통해 공유


PasswordRecovery.UserNameFailureText 속성

정의

사용자가 입력한 사용자 이름이 웹 사이트의 올바른 사용자 이름이 아닐 경우 표시되는 텍스트를 가져오거나 설정합니다.

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

속성 값

사용자가 입력한 사용자 이름이 웹 사이트의 올바른 사용자 이름이 아닐 경우 표시되는 텍스트입니다. 기본값은 "We were unable to access your information. 다시 시도하세요”와 같은 오류로 인해 실패합니다.

예제

다음 코드 예제에서는 UserNameFailureText 속성을 "해당 사용자 이름을 찾을 수 없습니다. 다시 시도하세요”와 같은 오류로 인해 실패합니다.

<%@ 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">
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>ASP.NET Example</title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:PasswordRecovery id="PasswordRecovery1" runat="server" 
            GeneralFailureText="You password cannot be retrieved at this time. Please try again later." 
            QuestionFailureText="Your answer does not match the stored answer. Please try again." 
            UserNameFailureText="We couldn't find that user name. Please try again.">
            <FailureTextStyle backcolor="Red" forecolor="White"></FailureTextStyle>
        </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">

    ' Insert page code here
    '

</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>ASP.NET Example</title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:PasswordRecovery id="PasswordRecovery1" runat="server" 
            GeneralFailureText="You password cannot be retrieved at this time. Please try again later." 
            QuestionFailureText="Your answer does not match the stored answer. Please try again." 
            UserNameFailureText="We couldn't find that user name. Please try again.">
            <FailureTextStyle backcolor="Red" forecolor="White"></FailureTextStyle>
        </asp:PasswordRecovery>
        <!-- Insert content here -->
    </form>
</body>
</html>

설명

합니다 UserNameFailureText 속성에 정의 된 멤버 자격 공급자가 인식 되지 않는 사용자 이름을 입력할 때 표시 되는 오류 메시지를 포함 합니다 MembershipProvider 속성입니다.

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

템플릿을 할당 하는 경우는 UserNameTemplate 속성을 UserNameFailureText 선택적인에 속성이 표시 됩니다 Literal 컨트롤를 ID "FailureText"로 설정 하는 속성.

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

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

적용 대상

추가 정보