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全球化和當地語系化

適用於

另請參閱