473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

ImageButton, Repeater and ItemDataBound

I've put an ImageButton control in a repeater.
I've set the 'OnItemBound' event of the repeater.

Why when I click on the ImageButton it doesn't work?
What else I have to do ?

Oct 1 '06 #1
1 4808
Did you wire up the button? You use events such as the OnItemBound to wire
up the controls yourself. In the code for your OnItemBound event, you'll
need to first find the control, then set the appropriate event handler for
the Image Button event that you want it to handle. Usually in a repeater
scenario I use the command event that way I can set a commandargument and
commandname with a value relevant to the record. Some code may look like

(ImageButton) myButton = (ImageButton)e.Item.FindControl("myButton");
myButton.Command = ((DbDataRecord)e.Item.DataItem).GetString(0);
myButton.CommandArgument = ((DbDataRecord)e.Item.DataItem).GetString(1);

myButton.Command += my command event handler
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
"RicercatoreSbadato" <em***********@yahoo.itwrote in message
news:11*********************@m73g2000cwd.googlegro ups.com...
I've put an ImageButton control in a repeater.
I've set the 'OnItemBound' event of the repeater.

Why when I click on the ImageButton it doesn't work?
What else I have to do ?

Oct 2 '06 #2

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

Similar topics

7
by: Scott Schluer | last post by:
Hi All, I have a functioning datagrid on "Page 1" that displays order information for a single order (this is for an e-commerce site). It's actually a combination of a couple datagrids to...
3
by: Charlie | last post by:
Hi: I would like to attach client side code to an imagebutton that is rendered in a Reapeater control. The client code will simply confirm if users wants to continue with an operation. In this...
3
by: WebMatrix | last post by:
I am struggling with implementing somewhat complicated UI web-control. I explored Repeater, but I am not sure if it's the best way to go. I am leaning towards writing my own custom control and...
1
by: fredda054 | last post by:
Hi everybody ! With help from some nice people here I'm getting close to solve my problem with dbnull values in a repeater. I got it pretty much done, I just ned to fix some syntax. I get a...
4
by: sck10 | last post by:
Hello, I have a repeater that is bound to a SQL Server table. I would like to place a summary in the footer for the item count and product cost. I have two fields. One for the product name...
7
by: | last post by:
I have what's probably a simple page lifecycle question related to dynamically evaluating values that are placed by a repeater and dynmically placing user controls that use those values. I'm...
4
by: adiel_g | last post by:
I am trying to loop through a repeater to retrieve a dataitem field but am getting a NullReferenceException. I can find a checkbox control but cannot find a dataitem field. Here is the code that...
0
by: Adam Right | last post by:
Hi All, i am using CommandArgument of imagebutton in a Repeater for adding a item to shopping basket, like that; ************************** <asp:Repeater ID="Repeater1" runat="server"...
4
by: Michael | last post by:
I have a repeater web control. Currently I want to change some row's color based on defined condition. Is there any code sample demonstrating how to accomplish it? Thanks.
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.