다음을 통해 공유


WebControl.Height 속성

정의

웹 서버 컨트롤의 높이를 가져오거나 설정합니다.

public:
 virtual property System::Web::UI::WebControls::Unit Height { System::Web::UI::WebControls::Unit get(); void set(System::Web::UI::WebControls::Unit value); };
[System.ComponentModel.Bindable(true)]
public virtual System.Web.UI.WebControls.Unit Height { get; set; }
public virtual System.Web.UI.WebControls.Unit Height { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.Height : System.Web.UI.WebControls.Unit with get, set
member this.Height : System.Web.UI.WebControls.Unit with get, set
Public Overridable Property Height As Unit

속성 값

컨트롤의 높이를 나타내는 A Unit 입니다. 기본값은 Empty입니다.

특성

예외

높이가 음수 값으로 설정되었습니다.

예제

다음 예제에서는 기본 클래스에서 WebControl 상속된 컨트롤의 Table 속성을 선언적으로 설정하는 Height 방법을 보여 줍니다.

<%@ Page Language="C#" AutoEventWireup="True" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Table Property</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h3>Property of a Table Web Control</h3>
 
        <asp:Table id="Table1" runat="server"
            CellPadding = "10" 
            CellSpacing="0"
            GridLines="Both"
            Height="300">

            <asp:TableRow>
                <asp:TableCell>
                    Row 0, Col 0
                </asp:TableCell>
                <asp:TableCell>
                    Row 0, Col 1
                </asp:TableCell>
            </asp:TableRow>

            <asp:TableRow>
                <asp:TableCell>
                    Row 1, Col 0
                </asp:TableCell>
                <asp:TableCell>
                    Row 1, Col 1
                </asp:TableCell>
            </asp:TableRow>
        </asp:Table>
    </div>
    </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">
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Table Property</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h3>Property of a Table Web Control</h3>
 
        <asp:Table id="Table1" runat="server"
            CellPadding = "10" 
            CellSpacing="0"
            GridLines="Both"
            Height="300">

            <asp:TableRow>
                <asp:TableCell>
                    Row 0, Col 0
                </asp:TableCell>
                <asp:TableCell>
                    Row 0, Col 1
                </asp:TableCell>
            </asp:TableRow>

            <asp:TableRow>
                <asp:TableCell>
                    Row 1, Col 0
                </asp:TableCell>
                <asp:TableCell>
                    Row 1, Col 1
                </asp:TableCell>
            </asp:TableRow>
        </asp:Table>
    </div>
    </form>
</body>
</html>

설명

Height 이 속성을 사용하여 웹 서버 컨트롤의 높이를 지정합니다.

메모

이 속성은 Microsoft Internet Explorer 버전 4 이전의 브라우저에서 모든 컨트롤에 대해 렌더링되지 않습니다. 이전 브라우저에서 이 속성을 렌더링하지 않는 컨트롤에는 , HyperLinkLinkButton및 유효성 검사 컨트롤이 포함Label됩니다. DataList RadioButtonList 또한 CheckBoxList해당 속성이 로 설정된 RepeatLayout.Flow경우 RepeatLayout 이전 브라우저에서 이 속성을 렌더링하지 않습니다. 또한 이전 브라우저에서는 단위 유형 PixelPercentage 만 지원됩니다.

이 속성은 표준이 아닌 HTML이므로 웹 서버는 Microsoft Internet Explorer 버전 4 이전의 브라우저에서 이 속성과 DataGrid같은 테이블로 Table 표시되는 컨트롤을 지원하지 않습니다.

메모

속성을 기본값Pixel이 아닌 단위 형식으로 설정 Height 하려면 원하는 단위 형식과 관련된 새 단위 형식을 만들어야 합니다. 예를 들어 컨트롤의 Height 속성을 백분율 값 100으로 설정하려면 다음을 수행할 수 있습니다.

myWebControl.Width = Unit.Percentage(100);

속성에 사용할 수 있는 단위 형식에 대한 Height 자세한 내용은 클래스를 참조하세요 Unit .

적용 대상

추가 정보