Saturday, March 24, 2012

Shopping Cart

Hi guys, I've been looking for a shopping cart to integrate into my site and I came across the following tutorial:

http://www.aspfree.com/c/a/C-Sharp/Formatting-an-Online-Shopping-Cart-PayPal-System/

my problem is that all the product info is hardcoded in and ideally i would draw it from the products table of my database. Does anyone know how I can do this? also.

You probably want to look through a data access tutorial

Data Access


Thanks. I've been having a look through these, this one in particular - http://asp.net/learn/data-access/tutorial-09-cs.aspx, which explainsMaster/Detail Filtering Across Two Pages. My problem comes with the ObjDataSource and trying to adapt this to my own database tables... I don't want to be using Northwind or presumably the BLL they specify, I just want to be able to click a "View Product" link next to the specified product in my GridView and for that to take me to another page where just the desired product's details are listed.


Well no, you wont want to use the exact match, you'll just want to adapt what they have to your own application.

In your case the easiest way would be just to have a hyperlink in your gridview with the url of the page you wish to view, and have a querystring value of that of the product.


Add a hyperlink column in your gridview

<asp:HyperLinkField DataNavigateUrlFields="ProductID" DataNavigateUrlFormatString="ViewProduct.aspx?ProductID={0}"
Text="View Product" />

0 comments:

Post a Comment