PasswordRecovery.FailureTextStyle プロパティ

定義

PasswordRecovery コントロールのエラー テキストの外観を定義するプロパティのコレクションへの参照を取得します。

public:
 property System::Web::UI::WebControls::TableItemStyle ^ FailureTextStyle { System::Web::UI::WebControls::TableItemStyle ^ get(); };
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public System.Web.UI.WebControls.TableItemStyle FailureTextStyle { get; }
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
member this.FailureTextStyle : System.Web.UI.WebControls.TableItemStyle
Public ReadOnly Property FailureTextStyle As TableItemStyle

プロパティ値

TableItemStyle

エラー テキストの外観を定義するプロパティを格納している TableItemStyle への参照。

属性

次のコード例では、プロパティを FailureTextStyle 使用して、コントロール内のエラー メッセージのスタイル プロパティを PasswordRecovery 設定します。

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

注釈

このプロパティは FailureTextStyle 、コントロール内のエラー メッセージの外観を PasswordRecovery 定義します。 このプロパティは読み取り専用です。ただし、返されるオブジェクトのプロパティを Style 設定できます。 これらのプロパティは、クラスのプロパティ (たとえばFailureTextStyle-ForeColor) Subproperty を表すStyleフォームProperty-Subpropertyで宣言によって設定できます。 このプロパティは、プログラムでフォーム Property.Subproperty (たとえば) FailureTextStyle.ForeColorで設定できます。

一般的な設定には、ユーザー設定の背景色、テキストの色、およびフォント プロパティが含まれます。 このプロパティは FailureTextStyle 、次のプロパティの外観を定義します。

プロパティの FailureTextStyle スタイル設定は、コントロールのスタイル設定 PasswordRecovery とマージされます。 プロパティで行われた設定は、 FailureTextStyle コントロールのプロパティ内の対応する設定を PasswordRecovery オーバーライドします。

PasswordRecovery のスタイル プロパティは、設定によって FailureTextStyle オーバーライドされます。

テンプレートを使用してコントロールの PasswordRecovery 外観を定義する場合、 FailureTextStyle プロパティは無効です。

適用対象

こちらもご覧ください