WebPartZoneBase.LayoutOrientation 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
영역의 컨트롤이 세로와 가로 방향 중 어느 방향으로 정렬될지를 나타내는 값을 가져오거나 설정합니다.
public:
virtual property System::Web::UI::WebControls::Orientation LayoutOrientation { System::Web::UI::WebControls::Orientation get(); void set(System::Web::UI::WebControls::Orientation value); };
public virtual System.Web.UI.WebControls.Orientation LayoutOrientation { get; set; }
member this.LayoutOrientation : System.Web.UI.WebControls.Orientation with get, set
Public Overridable Property LayoutOrientation As Orientation
속성 값
영역의 컨트롤이 정렬되는 방식을 결정하는 Orientation 값입니다. 기본 방향은 Vertical입니다.
예외
값이 열거된 Orientation 값 중 하나가 아닌 경우
예제
다음 코드 예제에서는 컨트롤에서 속성의 LayoutOrientation 선언적 및 프로그래밍 방식으로 사용 하는 방법을 WebPartZone 보여 줍니다. 코드 숨김 소스 파일 및 이 코드의 영역이 포함된 .aspx 페이지를 포함한 전체 코드 예제는 클래스 개요를 WebPartZoneBase 참조하세요.
속성에 LayoutOrientation 선언적 태그에 할당된 값이 있습니다. 이 값은 브라우저에 WebPartZone1
페이지를 로드한 후 영향을 줍니다. 영역의 웹 파트 컨트롤은 가로로 렌더링됩니다.
<asp:WebPartZone
ID="WebPartZone1"
Runat="server"
LayoutOrientation="Vertical" >
<EditVerb Text="Edit WebPart" />
<SelectedPartChromeStyle BackColor="LightBlue" />
<ZoneTemplate>
<asp:BulletedList
ID="BulletedList1"
Runat="server"
DisplayMode="HyperLink"
Title="Favorite Links" >
<asp:ListItem Value="http://msdn.microsoft.com">
MSDN
</asp:ListItem>
<asp:ListItem Value="http://www.asp.net">
ASP.NET
</asp:ListItem>
<asp:ListItem Value="http://www.msn.com">
MSN
</asp:ListItem>
</asp:BulletedList>
<asp:Calendar ID="Calendar1" Runat="server"
Title="My Calendar" />
</ZoneTemplate>
</asp:WebPartZone>
<asp:WebPartZone
ID="WebPartZone1"
Runat="server"
LayoutOrientation="Vertical" >
<EditVerb Text="Edit WebPart" />
<SelectedPartChromeStyle BackColor="LightBlue" />
<ZoneTemplate>
<asp:BulletedList
ID="BulletedList1"
Runat="server"
DisplayMode="HyperLink"
Title="Favorite Links" >
<asp:ListItem Value="http://msdn.microsoft.com">
MSDN
</asp:ListItem>
<asp:ListItem Value="http://www.asp.net">
ASP.NET
</asp:ListItem>
<asp:ListItem Value="http://www.msn.com">
MSN
</asp:ListItem>
</asp:BulletedList>
<asp:Calendar ID="Calendar1" Runat="server"
Title="My Calendar" />
</ZoneTemplate>
</asp:WebPartZone>
레이아웃 방향 설정/해제 단추를 클릭하여 영역의 방향을 변경할 수 있습니다. 방향을 토글하는 코드는 partial 클래스의 다음 코드 예제에서 발생합니다.
protected void Button2_Click(object sender, EventArgs e)
{
if (WebPartZone1.LayoutOrientation == Orientation.Vertical)
WebPartZone1.LayoutOrientation = Orientation.Horizontal;
else
WebPartZone1.LayoutOrientation = Orientation.Vertical;
Page_Load(sender, e);
}
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs)
If WebPartZone1.LayoutOrientation = Orientation.Vertical Then
WebPartZone1.LayoutOrientation = Orientation.Horizontal
Else
WebPartZone1.LayoutOrientation = Orientation.Vertical
End If
Page_Load(sender, e)
End Sub
설명
속성은 LayoutOrientation 웹 파트 컨트롤이 영역에 배치되는 방법에 관한 것입니다. 기본 Vertical 방향을 사용하면 각 컨트롤의 값에 따라 컨트롤이 위쪽에서 아래쪽 정렬로 ZoneIndex 렌더링됩니다. Horizontal 방향을 사용하면 컨트롤이 영역 너비에 따라 나란히 정렬됩니다.
Internet Explorer는 컨트롤의 WebPart 높이 및 컨트롤이 포함된 영역의 높이에 영향을 줄 수 있습니다. Internet Explorer는 호환 모드(이전 브라우저 버전과 이전 버전과 호환됨) 또는 표준 모드(페이지에 선언이 DOCTYPE
있는 경우 결정됨)로 웹 페이지를 렌더링합니다. 이러한 모드에 대한 자세한 내용은 DHTML compatMode 속성을 참조하세요. Internet Explorer가 표준 모드로 페이지를 렌더링하는 경우 일부 시나리오에서는 셀의 HTML 태그 <td height="100%">
가 있는 경우에도 테이블의 셀 크기를 조정하지 않습니다. 따라서 WebPart 컨트롤과 해당 포함 영역이 렌더링되므로 컨트롤이 영역의 전체 높이로 확장되지 않습니다.
이 유형의 렌더링은 두 가지 경우에 발생합니다.
영역의 LayoutOrientation 속성이 설정된 Vertical경우 영역에 높이를 명시적으로 설정합니다. 컨트롤이 영역의 전체 높이를 채우도록 하려면 가로 영역의 높이를 지정하지 마세요.
영역의 LayoutOrientation 속성이 설정된 Horizontal경우 영역의 높이(또는 포함된 컨트롤)를 명시적으로 설정하지 않습니다. 컨트롤이 영역의 전체 높이를 채울 수 있도록 하려면 영역 또는 컨트롤의 높이를 세로 영역으로 설정합니다.
이 항목의 코드 예제에서는 속성의 LayoutOrientation 일반적인 사용을 보여 줍니다. 높이 관련 렌더링 문제와 이를 해결하는 방법을 보여 주는 코드 예제는 속성을 참조 Height 하세요.