atlas对webpart的增强
记得早先曾埋怨过atlas的updatepanel对webpart的一系列控件支持的没有magicajax好.这个在最新的ctp当中似乎得到了改进.只是需要注意的地方是,关于webpartmanager和webpartzone一定要用atlas下的而不要用asp.net2.0自带的.至于其它的,就与magicajax没什么太大的区别了.
记得早先曾埋怨过atlas的updatepanel对webpart的一系列控件支持的没有magicajax好.这个在最新的ctp当中似乎得到了改进.只是需要注意的地方是,关于webpartmanager和webpartzone一定要用atlas下的而不要用asp.net2.0自带的.至于其它的,就与magicajax没什么太大的区别了.
其中生成的aspx文件如下:
最后,需要注意的地方就是,一定要用atlas下的webpartmanager与webpartzone.
代码下载
其中生成的aspx文件如下:
展开代码
1<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
2
3<%@ Register Assembly="Microsoft.Web.Atlas" Namespace="Microsoft.Web.UI" TagPrefix="cc1" %>
4<%@ Register Assembly="Microsoft.Web.Atlas" Namespace="Microsoft.Web.UI.Controls.WebParts"
5 TagPrefix="cc2" %>
6
7<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
8
9<html xmlns="http://www.w3.org/1999/xhtml" >
10<head runat="server">
11 <title>Untitled Page</title>
12</head>
13<body>
14 <form id="form1" runat="server">
15 <div>
16 <cc1:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="True">
17 </cc1:ScriptManager>
18
19 </div>
20 <cc1:UpdatePanel ID="UpdatePanel1" runat="server">
21 <ContentTemplate>
22 <cc2:WebPartManager ID="WebPartManager1" runat="server">
23 </cc2:WebPartManager>
24
25 <table border="0" cellpadding="0" cellspacing="0" style="width: 400px">
26 <tr>
27 <td style="width: 200px">
28 <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
29 <asp:ListItem Value="0">normal</asp:ListItem>
30 <asp:ListItem Value="1">design</asp:ListItem>
31 </asp:DropDownList></td>
32 <td style="width: 200px">
33 <cc1:UpdateProgress ID="UpdateProgress1" runat="server">
34 <ProgressTemplate>
35 <asp:Label ID="Label1" runat="server" Text="更新中,请稍侯"></asp:Label>
36 </ProgressTemplate>
37 </cc1:UpdateProgress>
38 </td>
39 </tr>
40 </table>
41 <br />
42 <br />
43 <br />
44 <table border="0" cellpadding="0" cellspacing="0" style="width: 300px">
45 <tr>
46 <td style="width: 100px; height: 19px">
47 <cc2:WebPartZone ID="WebPartZone1" runat="server" BorderColor="#CCCCCC" Font-Names="Verdana"
48 Padding="6">
49 <PartChromeStyle BackColor="#F7F6F3" BorderColor="#E2DED6" Font-Names="Verdana" ForeColor="White" />
50 <MenuLabelHoverStyle ForeColor="#E2DED6" />
51 <EmptyZoneTextStyle Font-Size="0.8em" />
52 <MenuLabelStyle ForeColor="White" />
53 <MenuVerbHoverStyle BackColor="#F7F6F3" BorderColor="#CCCCCC" BorderStyle="Solid"
54 BorderWidth="1px" ForeColor="#333333" />
55 <HeaderStyle Font-Size="0.7em" ForeColor="#CCCCCC" HorizontalAlign="Center" />
56 <ZoneTemplate>
57 <asp:Button ID="Button1" runat="server" Text="Button" />
58 </ZoneTemplate>
59 <MenuVerbStyle BorderColor="#5D7B9D" BorderStyle="Solid" BorderWidth="1px" ForeColor="White" />
60 <PartStyle Font-Size="0.8em" ForeColor="#333333" />
61 <TitleBarVerbStyle Font-Size="0.6em" Font-Underline="False" ForeColor="White" />
62 <MenuPopupStyle BackColor="#5D7B9D" BorderColor="#CCCCCC" BorderWidth="1px" Font-Names="Verdana"
63 Font-Size="0.6em" />
64 <PartTitleStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="0.8em" ForeColor="White" />
65 </cc2:WebPartZone>
66 </td>
67 <td style="width: 100px; height: 19px">
68 <cc2:WebPartZone ID="WebPartZone2" runat="server" BorderColor="#CCCCCC" Font-Names="Verdana"
69 Padding="6">
70 <PartChromeStyle BackColor="#F7F6F3" BorderColor="#E2DED6" Font-Names="Verdana" ForeColor="White" />
71 <MenuLabelHoverStyle ForeColor="#E2DED6" />
72 <EmptyZoneTextStyle Font-Size="0.8em" />
73 <MenuLabelStyle ForeColor="White" />
74 <MenuVerbHoverStyle BackColor="#F7F6F3" BorderColor="#CCCCCC" BorderStyle="Solid"
75 BorderWidth="1px" ForeColor="#333333" />
76 <HeaderStyle Font-Size="0.7em" ForeColor="#CCCCCC" HorizontalAlign="Center" />
77 <ZoneTemplate>
78 <asp:Image ID="Image1" runat="server" />
79 </ZoneTemplate>
80 <MenuVerbStyle BorderColor="#5D7B9D" BorderStyle="Solid" BorderWidth="1px" ForeColor="White" />
81 <PartStyle Font-Size="0.8em" ForeColor="#333333" />
82 <TitleBarVerbStyle Font-Size="0.6em" Font-Underline="False" ForeColor="White" />
83 <MenuPopupStyle BackColor="#5D7B9D" BorderColor="#CCCCCC" BorderWidth="1px" Font-Names="Verdana"
84 Font-Size="0.6em" />
85 <PartTitleStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="0.8em" ForeColor="White" />
86 </cc2:WebPartZone>
87 </td>
88 <td style="width: 100px; height: 19px">
89 <cc2:WebPartZone ID="WebPartZone3" runat="server" BorderColor="#CCCCCC" Font-Names="Verdana"
90 Padding="6">
91 <PartChromeStyle BackColor="#F7F6F3" BorderColor="#E2DED6" Font-Names="Verdana" ForeColor="White" />
92 <MenuLabelHoverStyle ForeColor="#E2DED6" />
93 <EmptyZoneTextStyle Font-Size="0.8em" />
94 <MenuLabelStyle ForeColor="White" />
95 <MenuVerbHoverStyle BackColor="#F7F6F3" BorderColor="#CCCCCC" BorderStyle="Solid"
96 BorderWidth="1px" ForeColor="#333333" />
97 <HeaderStyle Font-Size="0.7em" ForeColor="#CCCCCC" HorizontalAlign="Center" />
98 <ZoneTemplate>
99 <asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="White"
100 BorderWidth="1px" Font-Names="Verdana" Font-Size="9pt" ForeColor="Black" Height="190px"
101 NextPrevFormat="FullMonth" Width="350px">
102 <SelectedDayStyle BackColor="#333399" ForeColor="White" />
103 <TodayDayStyle BackColor="#CCCCCC" />
104 <OtherMonthDayStyle ForeColor="#999999" />
105 <NextPrevStyle Font-Bold="True" Font-Size="8pt" ForeColor="#333333" VerticalAlign="Bottom" />
106 <DayHeaderStyle Font-Bold="True" Font-Size="8pt" />
107 <TitleStyle BackColor="White" BorderColor="Black" BorderWidth="4px" Font-Bold="True"
108 Font-Size="12pt" ForeColor="#333399" />
109 </asp:Calendar>
110 </ZoneTemplate>
111 <MenuVerbStyle BorderColor="#5D7B9D" BorderStyle="Solid" BorderWidth="1px" ForeColor="White" />
112 <PartStyle Font-Size="0.8em" ForeColor="#333333" />
113 <TitleBarVerbStyle Font-Size="0.6em" Font-Underline="False" ForeColor="White" />
114 <MenuPopupStyle BackColor="#5D7B9D" BorderColor="#CCCCCC" BorderWidth="1px" Font-Names="Verdana"
115 Font-Size="0.6em" />
116 <PartTitleStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="0.8em" ForeColor="White" />
117 </cc2:WebPartZone>
118 </td>
119 </tr>
120 </table>
121 </ContentTemplate>
122 </cc1:UpdatePanel>
123 </form>
124</body>
125</html>
126
1<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
2
3<%@ Register Assembly="Microsoft.Web.Atlas" Namespace="Microsoft.Web.UI" TagPrefix="cc1" %>
4<%@ Register Assembly="Microsoft.Web.Atlas" Namespace="Microsoft.Web.UI.Controls.WebParts"
5 TagPrefix="cc2" %>
6
7<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
8
9<html xmlns="http://www.w3.org/1999/xhtml" >
10<head runat="server">
11 <title>Untitled Page</title>
12</head>
13<body>
14 <form id="form1" runat="server">
15 <div>
16 <cc1:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="True">
17 </cc1:ScriptManager>
18
19 </div>
20 <cc1:UpdatePanel ID="UpdatePanel1" runat="server">
21 <ContentTemplate>
22 <cc2:WebPartManager ID="WebPartManager1" runat="server">
23 </cc2:WebPartManager>
24
25 <table border="0" cellpadding="0" cellspacing="0" style="width: 400px">
26 <tr>
27 <td style="width: 200px">
28 <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
29 <asp:ListItem Value="0">normal</asp:ListItem>
30 <asp:ListItem Value="1">design</asp:ListItem>
31 </asp:DropDownList></td>
32 <td style="width: 200px">
33 <cc1:UpdateProgress ID="UpdateProgress1" runat="server">
34 <ProgressTemplate>
35 <asp:Label ID="Label1" runat="server" Text="更新中,请稍侯"></asp:Label>
36 </ProgressTemplate>
37 </cc1:UpdateProgress>
38 </td>
39 </tr>
40 </table>
41 <br />
42 <br />
43 <br />
44 <table border="0" cellpadding="0" cellspacing="0" style="width: 300px">
45 <tr>
46 <td style="width: 100px; height: 19px">
47 <cc2:WebPartZone ID="WebPartZone1" runat="server" BorderColor="#CCCCCC" Font-Names="Verdana"
48 Padding="6">
49 <PartChromeStyle BackColor="#F7F6F3" BorderColor="#E2DED6" Font-Names="Verdana" ForeColor="White" />
50 <MenuLabelHoverStyle ForeColor="#E2DED6" />
51 <EmptyZoneTextStyle Font-Size="0.8em" />
52 <MenuLabelStyle ForeColor="White" />
53 <MenuVerbHoverStyle BackColor="#F7F6F3" BorderColor="#CCCCCC" BorderStyle="Solid"
54 BorderWidth="1px" ForeColor="#333333" />
55 <HeaderStyle Font-Size="0.7em" ForeColor="#CCCCCC" HorizontalAlign="Center" />
56 <ZoneTemplate>
57 <asp:Button ID="Button1" runat="server" Text="Button" />
58 </ZoneTemplate>
59 <MenuVerbStyle BorderColor="#5D7B9D" BorderStyle="Solid" BorderWidth="1px" ForeColor="White" />
60 <PartStyle Font-Size="0.8em" ForeColor="#333333" />
61 <TitleBarVerbStyle Font-Size="0.6em" Font-Underline="False" ForeColor="White" />
62 <MenuPopupStyle BackColor="#5D7B9D" BorderColor="#CCCCCC" BorderWidth="1px" Font-Names="Verdana"
63 Font-Size="0.6em" />
64 <PartTitleStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="0.8em" ForeColor="White" />
65 </cc2:WebPartZone>
66 </td>
67 <td style="width: 100px; height: 19px">
68 <cc2:WebPartZone ID="WebPartZone2" runat="server" BorderColor="#CCCCCC" Font-Names="Verdana"
69 Padding="6">
70 <PartChromeStyle BackColor="#F7F6F3" BorderColor="#E2DED6" Font-Names="Verdana" ForeColor="White" />
71 <MenuLabelHoverStyle ForeColor="#E2DED6" />
72 <EmptyZoneTextStyle Font-Size="0.8em" />
73 <MenuLabelStyle ForeColor="White" />
74 <MenuVerbHoverStyle BackColor="#F7F6F3" BorderColor="#CCCCCC" BorderStyle="Solid"
75 BorderWidth="1px" ForeColor="#333333" />
76 <HeaderStyle Font-Size="0.7em" ForeColor="#CCCCCC" HorizontalAlign="Center" />
77 <ZoneTemplate>
78 <asp:Image ID="Image1" runat="server" />
79 </ZoneTemplate>
80 <MenuVerbStyle BorderColor="#5D7B9D" BorderStyle="Solid" BorderWidth="1px" ForeColor="White" />
81 <PartStyle Font-Size="0.8em" ForeColor="#333333" />
82 <TitleBarVerbStyle Font-Size="0.6em" Font-Underline="False" ForeColor="White" />
83 <MenuPopupStyle BackColor="#5D7B9D" BorderColor="#CCCCCC" BorderWidth="1px" Font-Names="Verdana"
84 Font-Size="0.6em" />
85 <PartTitleStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="0.8em" ForeColor="White" />
86 </cc2:WebPartZone>
87 </td>
88 <td style="width: 100px; height: 19px">
89 <cc2:WebPartZone ID="WebPartZone3" runat="server" BorderColor="#CCCCCC" Font-Names="Verdana"
90 Padding="6">
91 <PartChromeStyle BackColor="#F7F6F3" BorderColor="#E2DED6" Font-Names="Verdana" ForeColor="White" />
92 <MenuLabelHoverStyle ForeColor="#E2DED6" />
93 <EmptyZoneTextStyle Font-Size="0.8em" />
94 <MenuLabelStyle ForeColor="White" />
95 <MenuVerbHoverStyle BackColor="#F7F6F3" BorderColor="#CCCCCC" BorderStyle="Solid"
96 BorderWidth="1px" ForeColor="#333333" />
97 <HeaderStyle Font-Size="0.7em" ForeColor="#CCCCCC" HorizontalAlign="Center" />
98 <ZoneTemplate>
99 <asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="White"
100 BorderWidth="1px" Font-Names="Verdana" Font-Size="9pt" ForeColor="Black" Height="190px"
101 NextPrevFormat="FullMonth" Width="350px">
102 <SelectedDayStyle BackColor="#333399" ForeColor="White" />
103 <TodayDayStyle BackColor="#CCCCCC" />
104 <OtherMonthDayStyle ForeColor="#999999" />
105 <NextPrevStyle Font-Bold="True" Font-Size="8pt" ForeColor="#333333" VerticalAlign="Bottom" />
106 <DayHeaderStyle Font-Bold="True" Font-Size="8pt" />
107 <TitleStyle BackColor="White" BorderColor="Black" BorderWidth="4px" Font-Bold="True"
108 Font-Size="12pt" ForeColor="#333399" />
109 </asp:Calendar>
110 </ZoneTemplate>
111 <MenuVerbStyle BorderColor="#5D7B9D" BorderStyle="Solid" BorderWidth="1px" ForeColor="White" />
112 <PartStyle Font-Size="0.8em" ForeColor="#333333" />
113 <TitleBarVerbStyle Font-Size="0.6em" Font-Underline="False" ForeColor="White" />
114 <MenuPopupStyle BackColor="#5D7B9D" BorderColor="#CCCCCC" BorderWidth="1px" Font-Names="Verdana"
115 Font-Size="0.6em" />
116 <PartTitleStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="0.8em" ForeColor="White" />
117 </cc2:WebPartZone>
118 </td>
119 </tr>
120 </table>
121 </ContentTemplate>
122 </cc1:UpdatePanel>
123 </form>
124</body>
125</html>
126
最后,需要注意的地方就是,一定要用atlas下的webpartmanager与webpartzone.
代码下载
---------------------------------------------------------------
aspnetx的BI笔记系列索引:
使用SQL Server Analysis Services数据挖掘的关联规则实现商品推荐功能
---------------------------------------------------------------