특정 영역을 최소/최대화와 드래그 하여 위치 등 변경이 가능합니다.
Default.aspx |
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server">
<title></title> </head> <body>
<form id="form1" runat="server">
<div>
<asp:WebPartManager ID="WebPartManager" runat="server"></asp:WebPartManager>
<table border="1" width="100%"> <tr> <td colspan="3"> 메뉴 <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true" onselectedindexchanged="DropDownList1_SelectedIndexChanged"> <asp:ListItem Value="0">Browse</asp:ListItem> <asp:ListItem Value="1">Design</asp:ListItem> <asp:ListItem Value="2">Catalog</asp:ListItem> </asp:DropDownList> </td> </tr> <tr> <td> 영역1<br /> <asp:WebPartZone ID="WebPartZone1" runat="server"> <ZoneTemplate> <asp:Calendar ID="Calendar1" runat="server" Title="달력"></asp:Calendar> </ZoneTemplate>
</asp:WebPartZone> <br /> </td> <td> 영역2<br /> <asp:WebPartZone ID="WebPartZone2" runat="server"> <ZoneTemplate> <asp:Image ID="Image1" runat="server" Height="178px" Width="137px" Title="로고" /> </ZoneTemplate> </asp:WebPartZone> <br /> </td> <td> 영역3<br /> <asp:WebPartZone ID="WebPartZone3" runat="server"> <ZoneTemplate> <asp:Login ID="Login1" runat="server" Title="로그인"> </asp:Login> </ZoneTemplate> </asp:WebPartZone> </td> </tr>
</table>
<asp:CatalogZone ID="CatalogZone1" runat="server">
<ZoneTemplate> <asp:PageCatalogPart ID="PageCatalogPart1" runat="server" />
</ZoneTemplate>
</asp:CatalogZone>
</div>
</form> </body> </html>
컨트롤을 추가합니다. |
Default.aspx.cs |
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs
e) {
if (this.DropDownList1.SelectedValue == "0")
{
this.WebPartManager.DisplayMode
= WebPartManager.BrowseDisplayMode;
}
else if (this.DropDownList1.SelectedValue
== "1")
{
this.WebPartManager.DisplayMode
= WebPartManager.DesignDisplayMode;
}
else if (this.DropDownList1.SelectedValue
== "2")
{
this.WebPartManager.DisplayMode
= WebPartManager.CatalogDisplayMode;
} } |
결과화면 |
[그림69-1] |
'ASP.NET' 카테고리의 다른 글
71.C# ASP.NET - Ajax를 이용한 시간 출력 (0) | 2009.10.28 |
---|---|
70.C# ASP.NET - Ajax (0) | 2009.10.28 |
68.C# ASP.NET - Xml 웹 서비스 (0) | 2009.10.26 |
67.C# ASP.NET - 인증기능 적용 (0) | 2009.10.23 |
66.C# ASP.NET - Wizard 컨트롤 [WebStandardControls] (0) | 2009.10.23 |
Comments