473,320 Members | 1,881 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,320 software developers and data experts.

raising onclick event from nested imagebutton

Hi (again ^^)
In my ItemDataBound function,
I dynamically create an ImageButton.
I add to it an onclick event.

Anyway, when clicking my imagebutton, I don't raise the onclick event !
Any help will be appreciated ^^

*****
System.Web.UI.WebControls.ImageButton NewImg = new ImageButton();
NewImg.Click +=new ImageClickEventHandler(NewImg_Click);
NewImg.ImageUrl= Request.ApplicationPath + "/" +
dv.Row.ItemArray[3].ToString() ;
MyPlaceHolder.Controls.Add(NewImg);

private void NewImg_Click(object sender, ImageClickEventArgs e)
{
//code
}
Nov 19 '05 #1
0 1116

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

Similar topics

3
by: Jim Mitchell | last post by:
I have some code behind that generates 10 imagebutton controls.... I can not seem to figure out how to trap the onclick event for each image and determine which image was clicked. Can someone...
5
by: EMW | last post by:
My datagrid has four template columns in which an ImageButton is created. I use the following to add the OnClick event to the button. img.Attributes.Add("OnClick", "AllButtons_Click") The...
3
by: tshad | last post by:
I was trying to change my asp:button to asp:ImageButton, but got a message saying that ImageButton does not have an onClick function. How do I get the ImageButton call a function? Thanks, ...
0
by: Timothy H. Schilbach | last post by:
Hi Everyone, I have an easy question I think. I have this datagrid and it has a button in it that deletes a field in my database. I dont want someone to accidentally click on it and BOOM! data...
2
by: GD | last post by:
I have an ImageButton in a Repeater, and in the Repeater's OnItemDataBound event, I'd like to add some code that will let the ImageButton open a URL in a new window. This is what I have in my...
2
by: Gman | last post by:
Hi, I have created a usercontrol, a grid control essentially. Within it I have a class: clsGridRecord. I have coded the events such that when a user clicks on the grid, say, the events occur on...
1
by: fabrice | last post by:
Hello, I d like to modify the Onclik Event of an ImageButton control in code behind. But when i do it , i get an error. This is ma code : The control is the pasx page :
1
by: Big George | last post by:
Hello, Controls on webpage: - Datagrid - TextBox Datagrid has Delete button: <asp:TemplateColumn HeaderText="Borrar"> <HeaderStyle Width="10%"></HeaderStyle>
2
by: RSH | last post by:
Hi, I have been trying to follow a tutorial on raising an event from a user control and then handling it in the parent page. The article is a little vague so I believe I have the code in...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.