ASP.NET
  Home arrow ASP.NET arrow Page 4 - User and Role Management for an ASP.NET AJ...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
Moblin 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

User and Role Management for an ASP.NET AJAX Server-Centric Based Online Shopping Website
By: Xianzhong Zhu
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 4
    2007-12-19

    Table of Contents:
  • User and Role Management for an ASP.NET AJAX Server-Centric Based Online Shopping Website
  • Role Management
  • New Role
  • User Management
  • Deleting the Selected User
  • Adding Background Users

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    User and Role Management for an ASP.NET AJAX Server-Centric Based Online Shopping Website - User Management


    (Page 4 of 6 )


    User Management

    The first point to notice is that the "Usermange.aspx" page can be run independently. It can also be run in the mode that grants the current user  the identity of the "Super Administrator" role when he logs into the system. The second point to notice is that this is still a pure ASP.NET page. To simplify the design we isolate the "Adding a New User" operation from the main page (i.e. herein the "Usermange.aspx" page). Maybe in other design ideas the adding operation together with the "Usermange.aspx" page will be incorporated into one page, which will drastically increase the complexity of the design. The design complexity will also be increased, of course, when other ASP.NET AJAX solutions are advised to be used such as the UpdatePanelcontrol as well as the PopupControl Extender to facilitate the in-place editing, etc.

    As usual, let’s first have a look at the design-time snapshot of the "Usermange.aspx" page, as shown in Figure 13.


    Figure 13—the design-time snapshot for managing users


    Seen from the above figure, the following functionalities will be performed in this page:

    1. Display the present users’ info in an ASP.NET 2.0 GridView control.
    2. Provide hyperlinks to add new users by clicking the "Add new user" button.
    3. Provide hyperlinks to modify ready users by clicking the "Edit" hyperlink within the GridView control. 
    4. Delete current users by clicking the "X" hyperlink within the GridView control. 
    5. View the interested user’s detailed info by clicking the fields in the "User Name" column within the GridView control to redirect the current user to another "UserInfo.aspx" page.

    Page Initialization

    During the course of the initialization of the page, the main functionality is to display the general user info within the GridView control, i.e. binding data to the "UserView" GridView. The associated code is listed as follows:

    protected void Page_Load(object sender,EventArgs e)

    { ///bind data to the GridView control

    if(!Page.IsPostBack) {

    BindUserData();

    }

    }

    private void BindUserData(){

    ///define the class that gets the data

    User user = new User();

    SqlDataReader dr = user.GetUsers();

    ///Set the control's data source

    UserView.DataSource = dr;

    ///bind data to the control

    UserView.DataBind();

    ///Close the database connection

    dr.Close();

    }

    Here with the help of the GetUsers member methodof the User class, we have easily achieved our goal.

    More ASP.NET Articles
    More By Xianzhong Zhu


     

    ASP.NET ARTICLES

    - Enhancing PHP Via the ASP.NET AJAX Framework...
    - Enhancing PHP Programming with the ASP.NET A...
    - Classes and ASP.NET AJAX
    - Using ASP.NET AJAX
    - Building a Simple Storefront with LINQ
    - Developing a Dice Game Using ASP.NET Futures...
    - Completing an ASP.NET AJAX Server-Centric Ba...
    - Information Management for an ASP.NET AJAX S...
    - Comment and Order Management for an ASP.NET ...
    - Back-end Management Tasks for an ASP.NET AJA...
    - User Information Management for an ASP.NET A...
    - Adding Comments and Search to an ASP.NET AJA...
    - Order-Related Modules for an ASP.NET AJAX Se...
    - User and Role Management for an ASP.NET AJAX...
    - Programming an ASP.NET AJAX Server-Centric B...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway