Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ImageButton, Repeater and ItemDataBound

Reply
Thread Tools

ImageButton, Repeater and ItemDataBound

 
 
RicercatoreSbadato
Guest
Posts: n/a
 
      10-01-2006
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 ?

 
Reply With Quote
 
 
 
 
Mark Fitzpatrick
Guest
Posts: n/a
 
      10-02-2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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 ?
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Repeater: Items.count in ItemDataBound Event Josh Daws ASP .Net 2 09-11-2006 10:32 PM
Repeater - ItemDataBound and ItemCreated Dennis E. Jones, Jr. ASP .Net 4 11-18-2005 05:45 PM
ItemDataBound of repeater... Before or after render? Darren Clark ASP .Net 2 08-31-2004 07:24 AM
Repeater ItemCreated vs ItemDataBound =?Utf-8?B?S2V2aW4gSGVjdG9y?= ASP .Net 1 04-11-2004 12:23 PM
Re: ItemDataBound in Repeater: FYI René Paschold ASP .Net 2 10-16-2003 06:39 AM



Advertisments