Share via


PasswordRecovery.GeneralFailureText 属性

定义

获取或设置当 PasswordRecovery 控件的成员资格提供程序存在问题时显示的错误消息。

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

属性值

由于成员资格提供程序的问题,用户的密码不会通过电子邮件发送时显示的错误消息。 默认值为“您恢复密码的尝试失败。 请重试。”

示例

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

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

注解

GeneralFailureText 管理控件的用户信息 PasswordRecovery 的成员资格提供程序出现问题时,将向用户显示 属性。 通常, GeneralFailureText 当成员资格提供程序无法连接到包含用户信息的数据存储时,将显示 属性。

当提供程序在 UserNameFailureText 数据库中找不到指定的用户名时,将在 UserName 视图中显示属性中指定的文本。 QuestionFailureText当用户输入的答案与存储的答案不匹配时,属性将显示在“问题”视图中。 针对 GeneralFailureText 所有其他错误显示 属性。

属性的外观 GeneralFailureText 由 属性中的样式设置 FailureTextStyle 定义。

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

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

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

适用于

另请参阅