Datalist help needed!

V

VB Programmer

I am making a data driven shopping cart.

I'm using a datalist for the list of products. The item template consists
of:
- Product Id
- Product Picture
- Product Description
- Price
- Qty
- Add to Cart image button

1. When I double click on the image button (Item Template view) it doesn't
auto create the code behind declaration. Am I not allowed to use a button
in a datalist item template?
2. How can I "reference" the "current" product from the button? Example:
They click on product 123 and I want to put the Product Id/Price into a
variable.

Thanks!
 
S

S. Justin Gengo

VB Programmer,

I have an example of a how to reference a checkbox which is added to a
datagrid when it autoposts back to a page. It's really the same thing you
are trying to do with your button click and the code you'll need will be
very similar. If you go to my site, www.aboutfortunate.com, and click on the
"Code Library" link at the top and then use the search box that will appear
to search for "Checkbox in Datagrid" or something similar you'll find the
code example that will help you.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
J

john_teague

wire up the DataList ItemCommand Event. This fires when any button is
clicked in the DataList.

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,173
Latest member
GeraldReund
Top