http://www.binaryintellect.net/articles/displayarticle.aspx?id=7
![](/images/cnblogs_com/clingingboy/ec01.gif)
E-Commerce Starter Kit 是一个电子商务系统,采用最新的asp.net2.0技术.
自己打算一边学习一边分析
1.母版
1.1顶部logo信息,登陆信息,页尾信息
![](/images/cnblogs_com/clingingboy/ec02.gif)
![](/images/cnblogs_com/clingingboy/ec03.gif)
![](/images/cnblogs_com/clingingboy/ec04.gif)
logo图片信息和尾部信息保存在web.config里面
转到母板后台代码,可以看到
1
protected void Page_Load(object sender, EventArgs e)
2
{
3
//页标题,logo信息,两个联系信息
4
Page.Title = ConfigurationManager.AppSettings["pagetitle"];
5
HyperLink1.ImageUrl = "~/" + ConfigurationManager.AppSettings["imagefolder"] + "/" + ConfigurationManager.AppSettings["sitelogo"];
6
lnkAds.NavigateUrl = "mailto:" + ConfigurationManager.AppSettings["advertiseemail"];
7
lnkWebmaster.NavigateUrl = "mailto:" + ConfigurationManager.AppSettings["webmasteremail"];
8
}
![](/Images/OutliningIndicators/None.gif)
2
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
3
![](/Images/OutliningIndicators/InBlock.gif)
4
![](/Images/OutliningIndicators/InBlock.gif)
5
![](/Images/OutliningIndicators/InBlock.gif)
6
![](/Images/OutliningIndicators/InBlock.gif)
7
![](/Images/OutliningIndicators/InBlock.gif)
8
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)
接着看web.config自定义配置信息
1
<appSettings>
2
<add key="pagetitle" value="E-Commerce Starter Kit (Ver.1.0)"></add>
3
<add key="sitelogo" value="logo.gif"></add>
4
<add key="imagefolder" value="images"></add>
5
<add key="webmasteremail" value="webmaster@somesite.com"></add>
6
<add key="advertiseemail" value="sales@somesite.com"></add>
7
</appSettings>
![](/Images/OutliningIndicators/None.gif)
2
![](/Images/OutliningIndicators/None.gif)
3
![](/Images/OutliningIndicators/None.gif)
4
![](/Images/OutliningIndicators/None.gif)
5
![](/Images/OutliningIndicators/None.gif)
6
![](/Images/OutliningIndicators/None.gif)
7
![](/Images/OutliningIndicators/None.gif)
登陆信息处用了三个用户控件
LoginName 控件将显示该用户的登录名,用户登陆后显示欢迎信息
当用户登录后显示购物车和购物历史,否则不显示
LoginStatus 控件为没有通过身份验证的用户显示登录链接,为通过身份验证的用户显示注销链接.
1
<asp:LoginName ID="LoginName1" Runat="server" SkinID="FormLabel" FormatString="Welcome {0} !" />
2
3
<asp:LoginView ID="LoginView1" runat="server">
4
<LoggedInTemplate>
5
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/shoppingcart.aspx">View my Cart</asp:HyperLink>
6
|
7
<asp:HyperLink ID="HyperLink3" runat="server" NavigateUrl="~/OrderHistory.aspx">Order History</asp:HyperLink>
8
|
9
</LoggedInTemplate>
10
</asp:LoginView>
11
<asp:LoginStatus ID="LoginStatus1" Runat="server" LogoutPageUrl="~/default.aspx" LogoutAction="Redirect" />
![](/Images/OutliningIndicators/None.gif)
2
![](/Images/OutliningIndicators/None.gif)
3
![](/Images/OutliningIndicators/None.gif)
4
![](/Images/OutliningIndicators/None.gif)
5
![](/Images/OutliningIndicators/None.gif)
6
![](/Images/OutliningIndicators/None.gif)
7
![](/Images/OutliningIndicators/None.gif)
8
![](/Images/OutliningIndicators/None.gif)
9
![](/Images/OutliningIndicators/None.gif)
10
![](/Images/OutliningIndicators/None.gif)
11
![](/Images/OutliningIndicators/None.gif)
2. 搜索模块
![](/images/cnblogs_com/clingingboy/ec05.gif)
3.产品分类模块
![](/images/cnblogs_com/clingingboy/ec06.gif)
4.热销产品模块
![](/images/cnblogs_com/clingingboy/ec07.gif)
中间模块主要用于产品信息及其他内容
搜索模块,产品分类模块,热销产品模块分别作为单独的用户控件
![](/images/cnblogs_com/clingingboy/ec08.gif)
接着我们继续分析其他页面