473,486 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Datalist help needed!

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!
Nov 19 '05 #1
2 1275
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
"VB Programmer" <do**@emailme.com> wrote in message
news:eO****************@tk2msftngp13.phx.gbl...
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!

Nov 19 '05 #2
wire up the DataList ItemCommand Event. This fires when any button is
clicked in the DataList.

John

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1317
by: Thanh | last post by:
I created an ASP.NET project and dropped a DataList on the web form. I then wrote a simple class to return data: namespace Playing { public class PositionData { private string name; private...
1
10904
by: bill yeager | last post by:
I have a datagrid control within a datalist control. When I try and do a "Find" on the control, the object comes back with nothing and then my pgm crashes. I am 100% sure that my datagird inside...
8
7424
by: Adam Billmeier | last post by:
Problem: I am trying to use FindControl to grab a dropdownlist that is in the EditItemTemplate of a Datalist and then Bind it to a dataset. I also then need to put the correct values in all of...
10
2817
by: Bharat | last post by:
Hi Folks, Suppose I have two link button on a page (say lnkBtn1 and lnkBtn2). On the click event of the lnkbtn1 I have to add a dynamically created control. And On the click event of the lnkBtn2 I...
0
3523
by: ghafranabbas | last post by:
This is how you use the customvalidator control in any INamingContainer interface control (Datagrid, DataList, DataRepeater, etc). 1. In the ItemTemplate, place your customvalidator 2. Set the...
8
5877
by: bienwell | last post by:
Hi, I have a problem of displaying data bound by a datalist control. In my table, I have a field Start_date which has Short Date data type. I tried to update this field by Current Date. After...
0
1686
by: bryanp10 | last post by:
I have a DataList on my page which contains multiple DropDownLists. My page defaults to showing six rows in the DataList. I want the ability to dynamically add rows if needed. Right now I'm just...
1
1899
by: Jim Heavey | last post by:
First time trying to use the Datalist and I can not seem to get the events to fire. I set up my Data List control and I identify the event for the "OnEditCommand". I also set up an...
0
1680
by: s.gregory | last post by:
My page layout is like this: Page >DataList (databound using ObjectDataSource1 contained in page) >>Items >>>UserControl >>>>GridView (databound using another ObjectDataSource2 contained in...
0
3923
by: Isz | last post by:
PROBLEM: This problem is related to the postback and handling events correctly. BACKGROUND: I have a datalist which acts as a tabbes list with horizontal layout. This datalist is bound to a...
0
6964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7173
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5427
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4863
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3066
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
259
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.