PasswordRecovery.TextLayout 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定值,其指定以水平配置還是垂直配置顯示 PasswordRecovery 控制項。
public:
virtual property System::Web::UI::WebControls::LoginTextLayout TextLayout { System::Web::UI::WebControls::LoginTextLayout get(); void set(System::Web::UI::WebControls::LoginTextLayout value); };
public virtual System.Web.UI.WebControls.LoginTextLayout TextLayout { get; set; }
member this.TextLayout : System.Web.UI.WebControls.LoginTextLayout with get, set
Public Overridable Property TextLayout As LoginTextLayout
屬性值
其中一個 LoginTextLayout 列舉值。 預設為 TextOnLeft。
例外狀況
TextLayout 屬性未設定為有效的 LoginTextLayout 列舉值。
範例
下列程式碼範例示範如何變更 TextLayout 屬性會影響控制項的外觀 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">
void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
if (DropDownList1.SelectedValue == "TextOnLeft")
{
PasswordRecovery1.TextLayout = LoginTextLayout.TextOnLeft;
}
if (DropDownList1.SelectedValue == "TextOnTop")
{
PasswordRecovery1.TextLayout = LoginTextLayout.TextOnTop;
}
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<table border="1">
<tr>
<td> Choose text layout:
<asp:dropdownlist id="DropDownList1" runat="server"
autopostback="true" onselectedindexchanged="DropDownList1_SelectedIndexChanged">
<asp:listitem value="TextOnLeft">Left</asp:listitem>
<asp:listitem value="TextOnTop">Top</asp:listitem>
</asp:dropdownlist>
</td>
</tr>
<tr>
<td>
<asp:passwordrecovery id="PasswordRecovery1" runat="server"
textlayout="TextOnLeft">
</asp:passwordrecovery>
</td>
</tr>
</table>
</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">
Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
If DropDownList1.SelectedValue = "TextOnLeft" Then
PasswordRecovery1.TextLayout = LoginTextLayout.TextOnLeft
End If
If DropDownList1.SelectedValue = "TextOnTop" Then
PasswordRecovery1.TextLayout = LoginTextLayout.TextOnTop
End If
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<table border="1">
<tr>
<td> Choose text layout:
<asp:dropdownlist id="DropDownList1" runat="server"
autopostback="true" onselectedindexchanged="DropDownList1_SelectedIndexChanged">
<asp:listitem value="TextOnLeft">Left</asp:listitem>
<asp:listitem value="TextOnTop">Top</asp:listitem>
</asp:dropdownlist>
</td>
</tr>
<tr>
<td>
<asp:passwordrecovery id="PasswordRecovery1" runat="server"
textlayout="TextOnLeft">
</asp:passwordrecovery>
</td>
</tr>
</table>
</form>
</body>
</html>
備註
屬性 TextLayout 會指定控制項顯示 [答案]、[問題] 和 [使用者名稱] 文字方塊的欄位標籤的位置 PasswordRecovery 。 TextLayout當 屬性設定為 TextOnLeft (預設) 時,欄位標籤會顯示在文字方塊左側。 當 設定為 TextOnTop 時 TextLayout ,欄位標籤會出現在文字方塊上方。
標籤的文字分別在 、 QuestionLabelText 和 UserNameLabelText 屬性中 AnswerLabelText 指定。 欄位標籤的樣式設定是在 屬性中 LabelStyle 指定。
適用於
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應