Export (0) Print
Expand All

PasswordRecovery.TextLayout Property

Note: This property is new in the .NET Framework version 2.0.

Gets or sets a value that specifies whether to display the PasswordRecovery control in a horizontal or vertical layout.

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

public virtual LoginTextLayout TextLayout { get; set; }
/** @property */
public LoginTextLayout get_TextLayout ()

/** @property */
public void set_TextLayout (LoginTextLayout value)

public function get TextLayout () : LoginTextLayout

public function set TextLayout (value : LoginTextLayout)

Property Value

One of the LoginTextLayout enumeration values. The default is TextOnLeft.

Exception typeCondition

ArgumentOutOfRangeException

The TextLayout property is not set to a valid LoginTextLayout enumeration value.

The TextLayout property specifies where the PasswordRecovery control displays the field labels for the Answer, Question, and User Name text boxes. When the TextLayout property is set to TextOnLeft (the default), the field labels appear to the left of the text boxes. When TextLayout is set to TextOnTop, the field labels appear above the text boxes.

The text of the labels is specified in the AnswerLabelText, QuestionLabelText, and UserNameLabelText properties, respectively. The style settings for the field labels are specified in the LabelStyle property.

The following code example shows how changing the TextLayout property affects the appearance of the PasswordRecovery control.

<%@ page language="C#"%>
<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>
    <body>
        <form 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>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft