Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 21st, 2007, 10:09 AM
Registered User
 
Join Date: Apr 2007
Location: hengoed, mid glamorgan, United Kingdom.
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
  #2 (permalink)  
Old April 21st, 2007, 10:30 AM
Registered User
 
Join Date: Apr 2007
Location: hengoed, mid glamorgan, United Kingdom.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to darren0
Default

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!!!!


  #3 (permalink)  
Old April 24th, 2007, 10:02 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Banbury, , United Kingdom.
Posts: 105
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to DanM
Default

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
  #4 (permalink)  
Old September 21st, 2007, 11:22 AM
Registered User
 
Join Date: Sep 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

  #5 (permalink)  
Old December 18th, 2007, 04:05 PM
Registered User
 
Join Date: Nov 2007
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:16 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.