PasswordRecovery.QuestionLabelText 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定文字框標籤 Question 的文字。
public:
virtual property System::String ^ QuestionLabelText { System::String ^ get(); void set(System::String ^ value); };
public virtual string QuestionLabelText { get; set; }
member this.QuestionLabelText : string with get, set
Public Overridable Property QuestionLabelText As String
屬性值
文字框的 Question 標籤。 預設是「問題:
範例
以下程式碼範例設定了屬性 QuestionLabelText 。
<%@ 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>
備註
該 QuestionLabelText 屬性包含密碼恢復確認問題框的標籤文字。
屬性中包含的 LabelStyle 樣式設定定義了屬性 QuestionLabelText 的外觀。
當你用這個 QuestionTemplate 屬性來定義問題視圖的外觀時,這個 QuestionLabelText 屬性就沒有影響。
該屬性的預設文字會根據伺服器的區域設定在地化。
設定後,該屬性的值可透過設計工具自動儲存到資源檔案中。 欲了解更多資訊,請參閱LocalizableAttribute全球化與在地化。