PasswordRecovery.AnswerLabelText 屬性

定義

取得或設定密碼確認解答文字方塊的標籤文字。

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

屬性值

String

密碼確認解答文字方塊的標籤。 預設值為 [解答:]

範例

下列程式碼範例會將 AnswerLabelText 屬性設定為字串 「Your answer:」。

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

備註

屬性 AnswerLabelText 包含密碼復原確認回應文字方塊的標籤文字。

屬性中的 LabelStyle 樣式設定會定義 屬性中所 AnswerLabelText 指定文字的外觀。

如果您在 屬性中 QuestionTemplate 指派範本,屬性 AnswerLabelText 就不會有任何作用。

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

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

適用於

另請參閱