Share via


CreateUserWizard.InvalidQuestionErrorMessage 属性

定义

获取或设置输入的密码恢复问题无效时所显示的消息。

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

属性值

密码恢复问题无效时所显示的消息。 默认值为“请输入有效的答案”。控件的默认文本根据服务器的当前区域设置进行本地化。

示例

下面的代码示例更改 InvalidQuestionErrorMessage 成员资格提供程序的 属性,该提供程序将问题限制为字母数字字符 a-z、A-Z 和 0-9。 不会显示实际的成员资格提供程序。

<%@ 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 runat="server">
    <title>CreateUserWizard InvalidQuestionErrorMessage sample</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <asp:createuserwizard id="Createuserwizard1" runat="server"
        InvalidQuestionErrorMessage="Your question contains invalid characters. You question must contain only the letters a-z, A-Z and numbers 0-9.">
                <WizardSteps>
                <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
                </asp:CreateUserWizardStep>
                <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
                </asp:CompleteWizardStep>
            </WizardSteps>
      </asp:createuserwizard>
    </div>
    </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">

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>CreateUserWizard InvalidQuestionErrorMessage sample</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <asp:createuserwizard id="Createuserwizard1" runat="server"
        InvalidQuestionErrorMessage="Your question contains invalid characters. You question must contain only the letters a-z, A-Z and numbers 0-9.">
        <WizardSteps>
                <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
                </asp:CreateUserWizardStep>
                <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
                </asp:CompleteWizardStep>
            </WizardSteps>      
      </asp:createuserwizard>
    </div>
    </form>
</body>
</html>

注解

属性 Membership 中指定的 MembershipProvider 类成员资格提供程序可以限制它将接受的密码检索问题。 InvalidQuestionErrorMessage当用户输入的问题不符合成员资格提供程序设置的问题的要求时,将显示 属性。 问题的实际要求由成员资格提供程序确定,对于不同的提供程序,这些要求可能有所不同。

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

适用于

另请参阅