Back-end Management Tasks for an ASP.NET AJAX Server-Centric Based Online Shopping Website - Product Management
(Page 3 of 6 )
Product Management
Now it’s time to switch to another topic: product management. Note that these kinds of modules can be handled by both the super administrator and supplier roles. In detail, this part of the program's function is mainly composed of three pages: "ProductMain.aspx," "ProductManage.aspx" and "ProductLeft.aspx." Generally speaking, the product management function can be further divided into the following sub functionalities:
Show the product category info in control TreeView.
Show all the related products according to the selected product category.
Provide the hyperlinks to modify the product info.
Provide the hyperlinks to add new products.
Provide the hyperlinks to manage the product comments.
Delete the specified product.
View the selected product info.
ProductMain.aspx—the Main Page for Product Management
Author's Note: To partially update a web page there are several solutions besides AJAX. Here (and only here), we will leverage the <frame> mechanism to achieve the local updating effect. As for the <frame> solution, there a good many pros and cons about it. The "pros" mainly focus on the local updating effect to be introduced here while the "cons" mainly concern some kind of side effect associated with the search engine algorithm. Even so, there are still thousands of famous websites leveraging this technique.
To make a simple comparison, we painstakingly put the <frame> solution into use in this part. Thus, just for your reference!
To carefully study this page, let’s first take a look at its HTML code, as follows:
……(left out)
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untiled</title>
</head>
<frameset id="thisFrame" cols="180,*" rows="*" border="0"
framespacing="0">
<frame name="LeftFrame" src="ProductLeft.aspx" scrolling="no"
frameborder="0" noresize>
<frame name="MainFrame" src="ProductManage.aspx" scrolling="auto"
frameborder="0">
</frameset>
</html>
Here, there are two <frame> elements (LeftFrameand MainFrame) enclosed by a <frameset> element, with each linking to, or more precisely "loading," another two pages— "ProductLeft.aspx" and "ProductManage.aspx." Figure 28 shows the design-time snapshot for the "ProductLeft.aspx."
Figure 28—the design-time snapshot for the "ProductLeft.aspx" page
/Building_ASP.NET_AJAX_Server-Centric_Shopping_Website(8)_html_7ce6ab5.png)
There is mainly a TreeView control on this page that bears the responsibility of displaying the product category info. The initialization of the page that performs the task of binding data to the tree control is also simple:
protected void Page_Load(object sender,EventArgs e){
if(!Page.IsPostBack) {
BindCategoryData();
}
}
private void BindCategoryData(){
Category category = new Category();
category.InitCategory(CategoryView,"ProductManage.aspx");
}
Next: The Product Manage Page >>
More ASP.NET Articles
More By Xianzhong Zhu