Wrox Programmer Forums
BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8
This is the forum to discuss the Wrox book Beginning ASP.NET 2.0 by Chris Hart, John Kauffman, David Sussman, Chris Ullman; ISBN: 9780764588501
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 21st, 2007, 10:09 AM
Registered User
Join Date: Apr 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to darren0
Default Wrox beginning asp.NET 2.0 (e-commerce section)

Hi all, i have a problem when executing my application following the book descibed above, when building an index page for a product catalog and its interaction with a Product Item page. Ill try to be as consise as possible, and will post some code if requested. I'm presuming ive followed the book perfectly but still get an error.

1)added new item shop.aspx, added SqlDataSource control and successfully connects to my database, in order to read from a list of products. Consequently added required fields from products table using wizard

2)Added DataList control, selected SqlDataSource, edited templates to remove un-needed descriptions of ProductID etc. Deleted Picture URL label and replaced this with an image button. Then edited the data bindings for this image button entered a custom binding of the following code:

Eval ("PictureURL", "ProductImages\thumb_{0}")

3) selected custom binding for PriceLabel and set this to currency, and another trivial matter of changing Datalist properties from vertical to horizontal and no of colums to 4.

4)Run the page and it shows a successfull result in the browser, with Product details and images from SQL database (obviously the image button has no effect as of yet!!

5) added new item to the project called ShopItem.aspx (product item page which should be displayed when a user selects a product, giving more details etc)

6)added SqlDataSource control again, selected the relevant connectionstring. Once again selected the Products table from my database to read from, with the difference of entering a WHERE clause.

7)WHERE clause: column id from the column drop down list, query string from source and entered ProductID in the query string field. Therefore matching the product which the user selects from shop.aspx.

8)added datalist to ShopItem.aspx selected sqldatasource1 from the data source drop down list.

9)edited templates again and deleted all of the text alongside the labels, moving the pictureURL to the top.

10) i changed the pictureURL (in my database this column contains the images) URL of the image being displayed.

11)An image control was added, edited data bindings to a custom binding of: Eval ("PictureURL","ProductImages\{0}")
To this point both pages compile fine - no errors.

12)hyperlink added below the datalist control in shopItem.aspx and changed the navigateURL property to ~/Shop.aspx, so user can return back to the original page.

13)the application works fine up to this point, accessing the shopItems.aspx page and selecting the hyperlink takes me to shop.aspx.

14) Now this is wear things go wrong. going back to design view in Shop.aspx editing the datalist control, and the image button properties to make a postbackURL custom binding of:

Eval "ProductID", "ShopItem.aspx?ProductID={0}".

Execting the project takes me to Shop.aspx, but when i select on of the images from the product catalog i get an error. Also browsing to ShopItem.aspx directly allows me to go back to Shop.aspx without error.

I apologise for the length of the post, but i wanted to be consise, ive run this over and over today, ive carrid out the steps correctly in visual studio 2005 but the image button result in errors.

Please help if you can, ill post error info or code if needed.

Thanks all the same
Old April 21st, 2007, 10:30 AM
Registered User
Join Date: Apr 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to darren0

to clarify for 10) the 'PictureURLLabel' visible property was changed to 'false'. Reason being, i need the URL of the image in the database, but dont want the text displyed, so consquently this gives the reason for the image control being added!!!!

Old April 24th, 2007, 10:02 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 105
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to DanM

Hi darren,

Are you using the VB or the C# version of the book and which page are you working from?

Thanks, dan

Dan Maharry
Read the feed at http://feeds.feedburner.com/dansarchive
Old September 21st, 2007, 11:22 AM
Registered User
Join Date: Sep 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

Hi Derren

even i'm getting some problem with the same page but with the image, image is not dispalyed when i'm running the page i would be very thankful if u can please send me the whole code for uploading and displaying the image in the datalist.

Old December 18th, 2007, 04:05 PM
Registered User
Join Date: Nov 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts

Yes I got the error too. It is because the book forgot to put parenthesis in it.

Eval "ProductID", "ShopItem.aspx?ProductID={0}"

Should be:

Eval ("ProductID", "ShopItem.aspx?ProductID={0}")

That should fix the problem.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginning ASP.NET 2.0 E-Commerce in C# 2005 ckinds BOOK: Accessible XHTML and CSS Web Sites: Problem Design Solution 1 November 4th, 2006 06:09 PM
The code of "Beginning ASP.NET E-Commerce with ... 2003 Wrox Book Feedback 35 August 4th, 2006 04:56 AM
Help!About Beginning ASP.NET E-commerce eddiexie All Other Wrox Books 1 March 25th, 2005 09:42 AM
Beginning ASP.NET E-Commerce attipa All Other Wrox Books 1 July 11th, 2003 09:15 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.