Information Management for an ASP.NET AJAX Server-Centric Based Online Shopping Website - Leaving Words Management
(Page 3 of 4 )
Leaving Words Management
First, let's look at the run-time snapshot for leaving words management (the "leavewordManage.aspx"), as is shown in Figure 38.
Figure 38-the running-time snapshot for leaving words management
/Building_ASP.NET_AJAX_Server-Centric_Shopping_Website(10)_html_m41ebaf2f.png)
It's still easy-merely a GridView control on the page with a few related links embedded in it to perform the viewing and deleting operation.
Initialization and Data Binding
When the "leavewordManage.aspx" page is initialized, the related left words information is bound to the "LeavewordView" GridView so that the words left by customers are displayed within the grid control, as is shown in the following code:
protected void Page_Load(object sender,EventArgs e){
if(!Page.IsPostBack)
{ ///bind data to the control
BindLeavewordData();
}
}
private void BindLeavewordData(){
///define the class that gets the data
Leaveword word = new Leaveword();
SqlDataReader dr = word.GetLeavewords();
///Set the control's data source
LeavewordView.DataSource = dr;
///bind data to the control
LeavewordView.DataBind();
///Close the database connection
dr.Close();
}
Next: Deleting Left Words >>
More ASP.NET Articles
More By Xianzhong Zhu