Login.TextLayout 속성

정의

Login 컨트롤의 각 텍스트 상자와 연결된 레이블의 위치를 해당 텍스트 상자를 기준으로 지정합니다.

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

LoginTextLayout 열거형 값 중 하나입니다. 기본값은 TextOnLeft입니다.

예외

선택한 값이 LoginTextLayout 열거형 값 중 하나가 아닌 경우

예제

다음 코드 예제를 사용 하 여 보여 줍니다.는 LoginTextLayout 설정 하는 열거형을 TextLayout 의 속성을 Login 컨트롤입니다.

<%@ Page Language="C#" AutoEventWireup="False" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

  void ChangeTextLayout_Click(object sender, EventArgs e)
  {
      if (Login1.TextLayout == LoginTextLayout.TextOnLeft)
      {
          Login1.TextLayout = LoginTextLayout.TextOnTop;
      }
      else
      {
          Login1.TextLayout = LoginTextLayout.TextOnLeft;
      }
  }

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>TextLayout Example</title>
</head>
<body>
    <form id="Form1" runat="server">
    <h3>TextLayout Example</h3>
    <table style="text-align:center"
        border="1">
        <tr>
          <td align="center">
            <asp:Login id="Login1" 
              runat="server"
              orientation="Vertical" 
              textlayout="TextOnLeft">
            </asp:Login>
          </td>
        </tr>
        <tr>
          <td align="center">
            <asp:Button id="changeTextLayout" 
              runat="Server" 
              text="Change Text Layout" 
              onclick="ChangeTextLayout_Click" >
            </asp:Button> 
          </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 ChangeTextLayout_Click(sender as Object, e as EventArgs)
    
    If Login1.TextLayout = LoginTextLayout.TextOnLeft Then
      
      Login1.TextLayout = LoginTextLayout.TextOnTop
      
    Else
      
      Login1.TextLayout = LoginTextLayout.TextOnLeft
      
    End If
    
  End Sub

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>TextLayout Example</title>
</head>
<body>
    <form id="Form1" runat="server">
    <h3>TextLayout Example</h3>
    <table style="text-align:center"
        border="1">
        <tr>
          <td align="center">
            <asp:Login id="Login1" 
              runat="server"
              orientation="Vertical" 
              textlayout="TextOnLeft">
            </asp:Login>
          </td>
        </tr>
        <tr>
          <td align="center">
            <asp:Button id="changeTextLayout" 
              runat="Server" 
              text="Change Text Layout" 
              onclick="ChangeTextLayout_Click" >
            </asp:Button> 
          </td>
        </tr>
      </table>
    </form>
  </body>
</html>

설명

속성을 사용 하 여 TextLayout 컨트롤에 대 한 관련 된 텍스트 상자에 상대적인 레이블의 Login 위치를 지정할 수 있습니다. 이 속성은 LoginTextLayout 열거형의 값 중 하나로 설정됩니다. 다음 표에서 가능한 값을 나열합니다.

LoginTextLayout 값 Description
TextOnLeft 연결된 텍스트 입력 필드의 왼쪽에 레이블을 배치합니다.
TextOnTop 연결된 텍스트 입력 필드 위에 레이블을 배치합니다.

적용 대상

추가 정보