SunQuest
 
       ASP.NET
  Home arrow ASP.NET arrow Page 3 - User Information Management for an ASP.NET...
Iron Speed
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 
VeriSign Whitepapers 
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 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 / 3
    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

    Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

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


    (Page 3 of 4 )


    Page Initialization

    When the page is initialized, we should finish the task of loading the original user data and display it to them.

    protected void Page_Load(object sender,EventArgs e) {

    ///Get the value of the parameter

    if(Request.Params["UserID"] != null) {

    if(Int32.TryParse(Request.Params["UserID"].ToString(),out nUserID) == false) {

    return;

    }

    }

    if(!Page.IsPostBack) {

    ///bind data to the control

    if(nUserID > -1) {

    BindUserData(nUserID);

    }

    }

    SureBtn.Enabled = nUserID <= -1 ? false : true;

    }

    private void BindUserData(int nUserID) {

    ///Get the data

    User user = new User();

    SqlDataReader recr = user.GetSingleUser(nUserID);

    ///Read the data

    if(recr.Read()){

    ///display data

    UserName.Text = recr["UserName"].ToString();

    RealName.Text = recr["RealName"].ToString();

    Email.Text = recr["Email"].ToString();

    Phone.Text = recr["Phone"].ToString();

    Mobile.Text = recr["Mobile"].ToString();

    Remark.Text = recr["Remark"].ToString();

    Address.Text = recr["Address"].ToString();

    }

    recr.Close(); ///Close the data source

    }

    Here we still provide enough comments to which you can refer. Please remember that no matter which page you analyze in this sample, the basic initialization logic is quite similar. That will help you find your focus.


    Submitting the Modification

    Clicking the "OK" button will trigger its corresponding event handler, as follows:

    protected void SureBtn_Click(object sender,EventArgs e){

    User user = new User();

    user.UpdateUser(nUserID,RealName.Text,

    Address.Text,Phone.Text,Mobile.Text,

    Email.Text,Remark.Text);

    Response.Write("<script>window.alert('Changing user info successfully!')</script>");

    }

    Here, we first create an instance of the User class, and then invoke its UpdateUser member functionto finally submit the personal information to change the server side database. That’s it. As for the inner workings relating to UpdateUseritself, please refer to the downloadable source code accompanying this article.

    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...

    Iron Speed




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