ASP.NET
  Home arrow ASP.NET arrow Page 3 - Order-Related Modules for an ASP.NET AJAX ...
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

Order-Related Modules 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 / 2
    2007-12-26

    Table of Contents:
  • Order-Related Modules for an ASP.NET AJAX Server-Centric Based Online Shopping Website
  • Behind the Scenes
  • More Behind the Scenes Code
  • Web Handler
  • Buying Goods
  • Viewing the Shopping Cart
  • Page Initialization

  • 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

    Ajax Application Generator Generate database 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!

    Order-Related Modules for an ASP.NET AJAX Server-Centric Based Online Shopping Website - More Behind the Scenes Code


    (Page 3 of 7 )

    Second, we've leveraged one of the important triggers, AsyncPostBackTrigger,to invoke the updating action of the UpdatePanelcontrol. The following shows the related code:

    private void BindProductData(int nCategoryID){

    ///define the class that gets the data

    Product product = new Product();

    SqlDataReader dr = product.GetProductByCategory(nCategoryID);

    ///Set the control's data source

    ProductView.DataSource = dr;

    ///bind data to the control

    ProductView.DataBind();

    ///Close the database connection

    dr.Close();

    }

    ......

    protected void ProductList_ItemCommand(object source, DataListCommandEventArgs e){

    BindProductData(Int32.Parse(e.CommandArgument.ToString()));

    }

    Here we have already provided detailed comments. As you see, the general routine of the code is like those arranged in the previous modules. Here, the "ProductView" control corresponds to the ASP.NET GridView to display the selected goods, while the "ProductList" refers to the ASP.NET control named DataList to show the product category.

    For now, acute readers may have already detected a secret. Here, again, we list the related code:

    <a href='../Admin/Product/ProductInfo.aspx?ProductID=<%# DataBinder.Eval(Container.DataItem,"ProductID")%>' target="_blank">

    <asp:Panel ID="Panel1" runat="server" Height="50px" Width="125px">

    <asp:Image ID="ProductPicture" Runat="server" Width="90" Height="120" ImageUrl='<%# Eval("PictureID", "../Handler.ashx?Id={0}") %>' > </asp:Image>

    </asp:Panel></a>


    How can we display the images within the database? As the previous sections mentioned, we use a field of the "image" type to directly store the binary image data into the table. In earlier ASP.NET solutions, it is very difficult to show an image at the specified position on a web page, especially as the image data is persisted into the database table. Another commonly-used way to deal with image data is to independently store the image files while only their related paths are in the table. Each solution has its own pros and cons.

    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 6 hosted by Hostway