User and Role Management for an ASP.NET AJAX Server-Centric Based Online Shopping Website - New Role
(Page 3 of 6 )
When the above pencil-like image button is clicked, the user is redirected to another page, "EditRole.aspx," whose running time snapshot is captured in the following Figure 11.
Figure 11—the running-time snapshot for Adding a new role
/Building_ASP.NET_AJAX_Server-Centric_Shopping_Website(4)_html_m425c0269.png)
The following code corresponds to the programming of the click event handler of the "Add" button:
protected void AddBtn_Click(object sender,EventArgs e) {
///add data
Role role = new Role();
role.AddRole(RoleName.Text);
Response.Write("<script>window.alert('Succeed in adding data!')</script>");
}
Here, first create an instance of the Role class, then by invoking the "AddRole" of the instance, the newly-entered role name is saved into the server-side database. That’s all.
When the "Add a New Role" button is clicked, however, the user will be redirected to another page, "AddRole.aspx," whose running time snapshot is captured in the following Figure 12.
Figure 12—the running-time snapshot for modifying a specified role
/Building_ASP.NET_AJAX_Server-Centric_Shopping_Website(4)_html_m52811f2a.png)
Also a simple page! And since the coding behind is pretty intelligible too, we are not going to waste any ink on the explanation. Interested readers may do further research by examining the downloadable source code.
Next: User Management >>
More ASP.NET Articles
More By Xianzhong Zhu