C#
  Home arrow C# arrow Page 4 - Formatting an Online Shopping Cart/PayPal ...
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 
Mobile Linux 
App Generation ROI 
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? 
C#

Formatting an Online Shopping Cart/PayPal System
By: Tann San
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 11
    2006-06-27

    Table of Contents:
  • Formatting an Online Shopping Cart/PayPal System
  • Making it Pretty
  • Padding and Spacing
  • Product Paging

  • 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


    Formatting an Online Shopping Cart/PayPal System - Product Paging


    (Page 4 of 4 )

    "Paging" is the process of splitting up the displayed data onto multiple pages and providing navigation between each of them.  This can be handled in several ways, and everyone who's used it has their preferred methods.


    Sometimes it comes down to the DataSource you're using.  Some databases such as PostgreSQL let you perform select queries and return x number of results starting at offset y, so you can do paging directly from your database, which is excellent if you have hundreds, thousands or possibly millions of records to sort through. This feature is not supported by a lot of other database systems, so you can be creative by implementing your own paging on a database with some where clause trickery, or if all else fails and you've had to pull all the records you can still sort them on the server side with the PagedDataSource class. This is pretty neat, but if you're having trouble getting your head around DataTables and DataSets or you're just short on time, you can quickly implement paging with the GridView.  Paging is enabled on the product listing via:

      AllowPaging="True"

    and has the number of items to show per page specified with:

      PageSize="3"

    There are six products in the demonstration shop so you can see two page links at the bottom of the GridView.

    Conclusion

    With this article we've looked at how to stylize the GridView to make it fit in with our site design using a number of techniques, including both inline and externally defined CSS as well as directly setting some of the HTML tables attributes. There's a whole host of other properties that can be set to alter the GridView's appearance, which you can see listed here at the MSDN site. Remember that you can pass your own table properties through the GridView, such as the summary property we passed earlier, so you're not restricted to what you can see listed on the GridView property page.

    If you're not sure something has been passed correctly, remember that you usually have the "View Source" option with your browser.  For IE and Opera you can right click the page and pick "View Source" or do View->Source from the main menu at the top.  It's similar for FireFox, except on the right click menu it's called "View Page Source" and with the main menu it's View->Page Source.  It's always nice to see what's going on under the hood, as it might give you further insights into better ways to optimize your code.

    You've now walked through how to create the DataSource, how to populate your GridView using that data and finally how to decorate it all to tie in with your site's design.  Hopefully you've also learned a few of other handy tips which should help you along the way.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · I'm open to...
       · Has anyone noticed erratic behavior when changing a quantity in the baskets form...
       · Hi, I hadn't noticed that behaviour until you pointed it out. It's due to the first...
       · I found this very helpful, thank you. I just need to figure out how to use products...
     

    C# ARTICLES

    - C# and XML
    - Pointers and Arrays in C#
    - C# 3.0 Extension Methods
    - Overloading Operators in C#
    - Iterators and Nullable Types
    - Patterns and Iterators in C#
    - C# Exceptions
    - Methods in C#
    - Delegates and Events in C#
    - Advanced C#
    - Working with Regular Expressions in C#
    - Sending Simple E-Mail in C#
    - Building C# Comparable Objects: IComparable ...
    - Color Transformation Applications in C# GDI+...
    - Performing Color Transformation Operations i...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT