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

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 / 4
    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


    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

    - 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 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek