<%@ Page Language="VB" MasterPageFile="~/day02/MyMaster.master" Title="Webパーツコントロール" %>

<%@ Register Src="AdRotator.ascx" TagName="AdRotator" TagPrefix="uc1" %>
<%@ Register Src="ImageMap.ascx" TagName="ImageMap" TagPrefix="uc2" %>
<%@ Register Src="RssReader.ascx" TagName="RssReader" TagPrefix="uc3" %>

<script runat="server">

    Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs)
        For Each mode As WebPartDisplayMode In manager.DisplayModes
            If mode.IsEnabled(manager) Then
                Dim item As ListItem = New ListItem(mode.Name)
                menu.Items.Add(item)
            End If
        Next
    End Sub

    Protected Sub menu_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        Try
            Select Case menu.SelectedValue
                Case "Browse"
                    manager.DisplayMode = WebPartManager.BrowseDisplayMode
                Case "Catalog"
                    manager.DisplayMode = WebPartManager.CatalogDisplayMode
                Case "Design"
                    manager.DisplayMode = WebPartManager.DesignDisplayMode
                Case "Edit"
                    manager.DisplayMode = WebPartManager.EditDisplayMode
            End Select
        Catch ex As ArgumentException
            Response.Write("指定された表示モードには対応していません。")
            manager.DisplayMode = WebPartManager.BrowseDisplayMode
        End Try
    End Sub
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="cph" Runat="Server">
    <asp:WebPartManager ID="manager" runat="server">
    </asp:WebPartManager>
    <asp:DropDownList ID="menu" runat="server" AutoPostBack="True" OnSelectedIndexChanged="menu_SelectedIndexChanged">
    </asp:DropDownList>
    <asp:WebPartZone ID="zone1" runat="server" BorderColor="#CCCCCC" Font-Names="Verdana"
        HeaderText="エリア1" LayoutOrientation="Horizontal" Padding="6">
        <PartChromeStyle BackColor="#FFFBD6" BorderColor="#FFCC66" Font-Names="Verdana" ForeColor="#333333" />
        <MenuLabelHoverStyle ForeColor="#FFCC66" />
        <EmptyZoneTextStyle Font-Size="0.8em" />
        <MenuLabelStyle ForeColor="White" />
        <MenuVerbHoverStyle BackColor="#FFFBD6" BorderColor="#CCCCCC" BorderStyle="Solid"
            BorderWidth="1px" ForeColor="#333333" />
        <HeaderStyle Font-Size="0.7em" ForeColor="#CCCCCC" HorizontalAlign="Center" />
        <ZoneTemplate>
            <uc1:AdRotator ID="ad" runat="server" Title="サイトロゴ" />
            <uc2:ImageMap ID="map" runat="server" Title="シリーズメニュー" />
        </ZoneTemplate>
        <MenuVerbStyle BorderColor="#990000" BorderStyle="Solid" BorderWidth="1px" ForeColor="White" />
        <PartStyle Font-Size="0.8em" ForeColor="#333333" />
        <TitleBarVerbStyle Font-Size="0.6em" Font-Underline="False" ForeColor="White" />
        <MenuPopupStyle BackColor="#990000" BorderColor="#CCCCCC" BorderWidth="1px" Font-Names="Verdana"
            Font-Size="0.6em" />
        <PartTitleStyle BackColor="#990000" Font-Bold="True" Font-Size="0.8em" ForeColor="White" />
    </asp:WebPartZone>
    <asp:WebPartZone ID="zone2" runat="server" BorderColor="#CCCCCC" Font-Names="Verdana"
        HeaderText="エリア2" Padding="6">
        <PartChromeStyle BackColor="#FFFBD6" BorderColor="#FFCC66" Font-Names="Verdana" ForeColor="#333333" />
        <MenuLabelHoverStyle ForeColor="#FFCC66" />
        <EmptyZoneTextStyle Font-Size="0.8em" />
        <MenuLabelStyle ForeColor="White" />
        <MenuVerbHoverStyle BackColor="#FFFBD6" BorderColor="#CCCCCC" BorderStyle="Solid"
            BorderWidth="1px" ForeColor="#333333" />
        <HeaderStyle Font-Size="0.7em" ForeColor="#CCCCCC" HorizontalAlign="Center" />
        <ZoneTemplate>
            <uc3:RssReader ID="reader" runat="server" RssFeed="http://www.wings.msn.to/redirect.php/-/A-12/" Title="サーバサイド技術の学び舎 - WINGS" />
        </ZoneTemplate>
        <MenuVerbStyle BorderColor="#990000" BorderStyle="Solid" BorderWidth="1px" ForeColor="White" />
        <PartStyle Font-Size="0.8em" ForeColor="#333333" />
        <TitleBarVerbStyle Font-Size="0.6em" Font-Underline="False" ForeColor="White" />
        <MenuPopupStyle BackColor="#990000" BorderColor="#CCCCCC" BorderWidth="1px" Font-Names="Verdana"
            Font-Size="0.6em" />
        <PartTitleStyle BackColor="#990000" Font-Bold="True" Font-Size="0.8em" ForeColor="White" />
    </asp:WebPartZone>
    <asp:CatalogZone ID="CatalogZone1" runat="server" BackColor="#FFFBD6" BorderColor="#CCCCCC"
        BorderWidth="1px" Font-Names="Verdana" Padding="6">
        <HeaderVerbStyle Font-Bold="False" Font-Size="0.8em" Font-Underline="False" ForeColor="#333333" />
        <PartTitleStyle BackColor="#990000" Font-Bold="True" Font-Size="0.8em" ForeColor="White" />
        <PartChromeStyle BorderColor="#FFCC66" BorderStyle="Solid" BorderWidth="1px" />
        <InstructionTextStyle Font-Size="0.8em" ForeColor="#333333" />
        <PartLinkStyle Font-Size="0.8em" />
        <EmptyZoneTextStyle Font-Size="0.8em" ForeColor="#333333" />
        <LabelStyle Font-Size="0.8em" ForeColor="#333333" />
        <VerbStyle Font-Names="Verdana" Font-Size="0.8em" ForeColor="#333333" />
        <ZoneTemplate>
            <asp:PageCatalogPart ID="PageCatalogPart1" runat="server" />
        </ZoneTemplate>
        <PartStyle BorderColor="#FFFBD6" BorderWidth="5px" />
        <SelectedPartLinkStyle Font-Size="0.8em" />
        <FooterStyle BackColor="#FFCC66" HorizontalAlign="Right" />
        <HeaderStyle BackColor="#FFCC66" Font-Bold="True" Font-Size="0.8em" ForeColor="#333333" />
        <EditUIStyle Font-Names="Verdana" Font-Size="0.8em" ForeColor="#333333" />
    </asp:CatalogZone>
    <asp:EditorZone ID="EditorZone1" runat="server" BackColor="#FFFBD6" BorderColor="#CCCCCC"
        BorderWidth="1px" Font-Names="Verdana" Padding="6">
        <HeaderStyle BackColor="#FFCC66" Font-Bold="True" Font-Size="0.8em" ForeColor="#333333" />
        <LabelStyle Font-Size="0.8em" ForeColor="#333333" />
        <HeaderVerbStyle Font-Bold="False" Font-Size="0.8em" Font-Underline="False" ForeColor="#333333" />
        <PartChromeStyle BorderColor="#FFCC66" BorderStyle="Solid" BorderWidth="1px" />
        <ZoneTemplate>
            <asp:AppearanceEditorPart ID="AppearanceEditorPart1" runat="server" />
            <asp:PropertyGridEditorPart ID="PropertyGridEditorPart1" runat="server" />
        </ZoneTemplate>
        <PartStyle BorderColor="#FFFBD6" BorderWidth="5px" />
        <FooterStyle BackColor="#FFCC66" HorizontalAlign="Right" />
        <EditUIStyle Font-Names="Verdana" Font-Size="0.8em" ForeColor="#333333" />
        <InstructionTextStyle Font-Size="0.8em" ForeColor="#333333" />
        <ErrorStyle Font-Size="0.8em" />
        <VerbStyle Font-Names="Verdana" Font-Size="0.8em" ForeColor="#333333" />
        <EmptyZoneTextStyle Font-Size="0.8em" ForeColor="#333333" />
        <PartTitleStyle Font-Bold="True" Font-Size="0.8em" ForeColor="#333333" />
    </asp:EditorZone>
</asp:Content>

