PasswordRecovery.TextLayout Proprietà

Definizione

Ottiene o imposta un valore che specifica se visualizzare il controllo PasswordRecovery in un layout orizzontale o verticale.

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

Valore della proprietà

LoginTextLayout

Uno dei valori dell'enumerazione LoginTextLayout. Il valore predefinito è TextOnLeft.

Eccezioni

La proprietà TextLayout non è impostata su un valore di enumerazione di LoginTextLayout valido.

Esempio

Nell'esempio di codice seguente viene illustrato come la modifica della TextLayout proprietà influisce sull'aspetto del PasswordRecovery controllo .

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

Commenti

La TextLayout proprietà specifica dove il PasswordRecovery controllo visualizza le etichette dei campi per le caselle di testo Answer, Question e User Name. Quando la TextLayout proprietà è impostata su TextOnLeft (impostazione predefinita), le etichette dei campi vengono visualizzate a sinistra delle caselle di testo. Quando TextLayout è impostato su TextOnTop, le etichette dei campi vengono visualizzate sopra le caselle di testo.

Il testo delle etichette viene specificato rispettivamente nelle AnswerLabelTextproprietà , QuestionLabelTexte UserNameLabelText . Le impostazioni di stile per le etichette dei campi vengono specificate nella LabelStyle proprietà .

Si applica a

Vedi anche