Bagikan melalui


PasswordRecovery.TextLayout Properti

Definisi

Mendapatkan atau mengatur nilai yang menentukan apakah akan menampilkan PasswordRecovery kontrol dalam tata letak horizontal atau vertikal.

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

Nilai Properti

Salah LoginTextLayout satu nilai enumerasi. Default adalah TextOnLeft.

Pengecualian

Properti TextLayout tidak diatur ke nilai enumerasi yang valid LoginTextLayout .

Contoh

Contoh kode berikut menunjukkan bagaimana mengubah TextLayout properti memengaruhi tampilan PasswordRecovery kontrol.

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

Keterangan

Properti TextLayout menentukan di mana PasswordRecovery kontrol menampilkan label bidang untuk kotak teks Jawaban, Pertanyaan, dan Nama Pengguna. TextLayout Saat properti diatur ke TextOnLeft (default), label bidang muncul di sebelah kiri kotak teks. Saat TextLayout diatur ke TextOnTop, label bidang muncul di atas kotak teks.

Teks label ditentukan dalam AnswerLabelTextproperti , , QuestionLabelTextdan UserNameLabelText , masing-masing. Pengaturan gaya untuk label bidang ditentukan dalam LabelStyle properti .

Berlaku untuk

Lihat juga