ASP.NET
  Home arrow ASP.NET arrow User Information Management for an ASP.NET...
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  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
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 Information 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
    2008-01-09

    Table of Contents:
  • User Information Management for an ASP.NET AJAX Server-Centric Based Online Shopping Website
  • Modifying Personal Info
  • Page Initialization
  • Viewing Personal Info

  • 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


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


    (Page 1 of 4 )

    In this seventh part of an eleven-part series, we will research common user information management tasks. This includes the topics of changing the password, modifying personal information, viewing private information, viewing the order information (discussed earlier), and more.
    A downloadable .rar file is available for this article.

    User Information Center

    Let's begin by discussing how to provide a feature that allows the users to modify their passwords.

    Editing Password

    This part is done through the "EditUserPwd.aspx" page whose design-time snapshot is shown in Figure 24 below.


    Figure 24—the page for the common users to edit password

    First of all, the ScriptManagercontrol is a must. Second, the Toolkit control PasswordStrengthmaybe the only thing that attracts our attention. Yes, as you may have imagined, when the user wants to change his password, besides verifying his old password with data in the database, we use the PasswordStrengthcontrol to confirm the safety strength of the newly-entered password and give him a friendly hint. Besides this, we have also leveraged two Validators, theRequiredFieldValidatorand the CompareValidatorto make sure the user enters the proper new password.

    The following only lists the code that is associated with the event handler of the "OK" button:

    protected void SureBtn_Click(object sender,EventArgs e){

    User user = new User();

    SqlDataReader dr = user.GetUserLogin(UserName.Text.Trim(),OldPassword.Text.Trim());

    ///read the value of UserID

    string sUserID = "";

    if(dr.Read()) { sUserID = dr["UserID"].ToString(); }

    ///Close the data source

    dr.Close();

    ///judge whether the old password he enters is correct or not

    if(sUserID == null || sUserID == "" || sUserID.Length < 0){

    Response.Write("<script>alert('" + "The old password is invalid. Please enter again!"

    + "');</script>");

    return;

    }

    ///Change the user password

    user.UpdateUserPwd(nUserID,NewPassword.Text.Trim());

    Response.Write("<script>alert('" + "You have successfully modified the password. Keep your data safely!"

    + "');</script>");

    }

    Here, there are already enough comments. The entire logic is easy to grasp, isn’t it?

    More ASP.NET Articles
    More By Xianzhong Zhu


     

    ASP.NET ARTICLES

    - Adding Content to a Static ASP.NET Website
    - Building a Static ASP.NET Website in a Basic...
    - Develop Your First ASP.NET Website with Visu...
    - Run ASP.NET in Windows XP Home with Cassini ...
    - How to Test a Web Application
    - How to Add Code and Validation Controls to a...
    - Working in Source and Split Views to Build a...
    - How to Build a Web Form for a One-Page Web A...
    - How to Develop a One-Page Web Application
    - An ASP.NET Web Application in Action
    - Developing ASP.NET Web Applications
    - An Introduction to ASP.NET Web Programming
    - Introduction to the ADO.NET Entity Framework...
    - Completing an In-Text Advertising System und...
    - Programming an In-Text Advertising System un...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek