ASP.NET
  Home arrow ASP.NET arrow Page 2 - Back-end Management Tasks for an ASP.NET A...
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

Back-end Management Tasks for an ASP.NET AJAX Server-Centric Based Online Shopping Website
By: Xianzhong Zhu
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 3
    2008-01-16

    Table of Contents:
  • Back-end Management Tasks for an ASP.NET AJAX Server-Centric Based Online Shopping Website
  • Moving Tree Nodes
  • Product Management
  • The Product Manage Page
  • Adding New Product
  • About Viewing Products

  • 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!

    Back-end Management Tasks for an ASP.NET AJAX Server-Centric Based Online Shopping Website - Moving Tree Nodes


    (Page 2 of 6 )


    Moving the Tree Nodes

    Here, we merge the two click event handlers for the "Move Upward" and "Move Downward" buttons together into one, as is indicated in the following code:

    protected void MoveBtn_Click(object sender,EventArgs e){

    string sCommandName = ((Button)sender).CommandName;

    if(CategoryView.SelectedNode == null) {

    Response.Write("<script>window.alert('Please select the item.')
    </script>");

    return;

    }

    ///define the class

    Category category = new Category();

    ///edit data

    category.UpdateCategoryOrder(Int32.Parse
    (CategoryView.SelectedNode.Value),sCommandName);

    BindCategoryData();

    }

    Obviously, the user must first select one of the tree nodes, and then click the related button, or he will get a corresponding warning. Note the moving operation is in fact to sort the product categories. If the category node is selected and the moving button is clicked, then the UpdateCategoryOrder methodof the Categoryclass is invoked to accomplish the related movement.

    Deleting the Tree Nodes

    Here’s the code related to the deletion operation.

    protected void DeleteBtn_Click(object sender,EventArgs e){

    if(CategoryView.SelectedNode == null){

    Response.Write("<script>window.alert('Please select the item.')</script>");

    return;

    }

    if(CategoryView.SelectedNode.ChildNodes.Count > 0){

    Response.Write("<script>window.alert('The node you are to delete still
    includes sub nodes and cannot be deleted!')</script>");

    return;

    }

    ///define the class

    Category category = new Category();

    ///delete data

    category.DeleteCategory(Int32.Parse(CategoryView.SelectedNode.Value));

    BindCategoryData();

    ///display the info of the operating result

    //Response.Write("<script>window.alert('You have succeeded in deleting
    data.')</script>");

    }

    As with the moving operation above, only if the related node is selected can the node be deleted; otherwise, the user will still receive a warning. Note here if the selected node has its child nodes, then it can not be deleted, i.e. the user can only directly delete the leaf node on the tree.

    Please note here that we've chosen to leave out discussion of the adding and modifying categories operations.

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

    Click Here




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