共用方式為


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 屬性會顯示在選擇性 Literal 控件 ID 中,並將屬性設定為 “FailureText”。

屬性的預設文字會根據伺服器的地區設定進行當地語系化。

設定時,這個屬性的值可以使用設計工具自動儲存到資源檔。 如需詳細資訊,請參閱 LocalizableAttribute全球化和當地語系化

適用於

另請參閱