PasswordRecovery.UserNameLabelText プロパティ

定義

[ユーザー名] ボックスのラベル テキストを取得または設定します。

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

プロパティ値

String

[ユーザー名] ボックスのラベル。 既定値は、"ユーザー名:" です。

次のコード例では、プロパティを UserNameLabelText "Your user name:" に設定します。

<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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" 
      AnswerLabelText="Your answer:" 
      QuestionLabelText="Answer this question:" 
      UserNameLabelText="Your user name:">
      <LabelStyle 
        font-bold="True" 
        forecolor="White"
        backcolor="Navy">
      </LabelStyle>
    </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">
<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" 
      UserNameLabelText="Your user name:" 
      QuestionLabelText="Answer this question:" 
      AnswerLabelText="Your answer:">
      <LabelStyle 
        font-bold="True" 
        forecolor="White"
        backcolor="Navy">
      </LabelStyle>
    </asp:PasswordRecovery>
  </form>
</body>
</html>

注釈

この UserNameLabelText プロパティには、テキスト ボックスのラベル テキストが UserName 含まれています。

プロパティのスタイル設定は、 LabelStyle プロパティの外観を UserNameLabelText 定義します。

テンプレートをプロパティに UserNameTemplate 割り当てると、 UserNameLabelText プロパティは無効になります。

プロパティの既定のテキストは、サーバーのロケール設定に基づいてローカライズされます。

このプロパティの値を設定すると、デザイナー ツールを使用してリソース ファイルに自動的に保存できます。 詳細については、「グローバリゼーションとローカリゼーション」を参照してくださいLocalizableAttribute

適用対象

こちらもご覧ください