Share via


PasswordRecovery.QuestionFailureText 属性

定义

获取或设置在用户的密码恢复确认提示问题答案与网站数据存储中存储的答案不匹配时显示的文本。

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

属性值

当用户的密码恢复确认提示问题答案与网站数据存储中存储的答案不匹配时显示的文本。 默认值为“未能验证您的答案。 请重试。”

示例

下面的代码示例设置 属性 QuestionFailureText

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

注解

属性 QuestionFailureText 包含当密码恢复确认问题的答案与网站数据存储中存储的答案不匹配时显示的错误消息。

属性中的 FailureTextStyle 样式设置定义 属性的外观 QuestionFailureText

使用模板定义控件的外观PasswordRecovery时,QuestionFailureText属性显示在属性设置为“FailureText”的ID可选Literal控件中。

属性的默认文本根据服务器的区域设置进行本地化。

设置此属性的值时,可以使用设计器工具自动保存到资源文件。 有关详细信息,请参阅 LocalizableAttribute全球化和本地化

适用于

另请参阅