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

プロパティ値

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

適用対象

こちらもご覧ください