473,399 Members | 3,106 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,399 software developers and data experts.

Problem with addHandler for ImageButton

Hi All,


I'm having a problem with a small bit of code:
Dim deleteButton = New System.Web.UI.WebControls.ImageButton
deleteButton.imageURL = "images/icondelete.gif"
deleteButton.ToolTip = "Delete Data Source"
deleteButton.CommandArgument = "Delete1"
AddHandler deleteButton.Click, AddressOf DeleteDataSource_Click

The AddHandler can't compile, I'm getting the following error:
BC30676: 'Click' is not an event of 'Object'.

deleteButton.ToolTip = "Delete Data Source"
deleteButton.CommandArgument = "Delete1"
AddHandler deleteButton.Click, AddressOf DeleteDataSource_Click

It looks like the compiler can't figure out what kind of object "deleteButton" is...

I look forward to your help :)

Uffe
Apr 1 '07 #1
5 2580
I still haven't got any replies on this topic... so now it's bumped
Apr 2 '07 #2
Motoma
3,237 Expert 2GB
What kind of error messages do you receive?
Apr 2 '07 #3
What kind of error messages do you receive?
I'm getting the error:
BC30676: 'Click' is not an event of 'Object'.

Searching on google for the error, doesn't really give any clue, the error should be something like:

BC30676: 'Click' is not an event of 'System.Web.UI.WebControls.ImageButton', or something like that...
Apr 3 '07 #4
Motoma
3,237 Expert 2GB
I'm getting the error:
BC30676: 'Click' is not an event of 'Object'.

Searching on google for the error, doesn't really give any clue, the error should be something like:

BC30676: 'Click' is not an event of 'System.Web.UI.WebControls.ImageButton', or something like that...
Just a thought, try:
Expand|Select|Wrap|Line Numbers
  1. Dim deleteButton as New System.Web.UI.WebControls.ImageButton
  2.  
Apr 3 '07 #5
try this way


AddHandler deleteButton.Command, AddressOf DeleteDataSource_Click

private sub DeleteDataSource_Click(sender as object, e as System.Web.UI.WebControls.CommandEventArgs)
...... ur code goes here
end sub
Jun 20 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: George K | last post by:
Hi, i have a very irriting problem that i have written a short piece of code to demonstrate. The problem is that my aspx page is not fully refreshed after an event, which is delegated to an...
4
by: Rodrigo DeJuana | last post by:
Howdy, I'm new to this .net stuff and really have little to no training. Im trying to create a new page for a web form, so i have been pretty much jsut coping code. I having some issue with...
1
by: Tee | last post by:
Hi, I have a server control Table with each row will contain a dynamic created ImageButton. And I have a private sub with the proper delegate of an ImageButton click which handle nothing....
7
by: UGH | last post by:
I am adding image buttons dynamically and I need to add event handler when the user clicks on one of those image buttons which will have different id for reports. Here is my code LnkImage =...
3
by: Aaron | last post by:
Why do my session values return to nothing on post back? I want to click a button and have the row, as in: dataset.table(0).rows(THIS ROW NUMBER IS WHAT I AM TALKING ABOUT), either increment or...
2
by: Toni | last post by:
I have ImageButton array. I have defined onClick event and it works. But in this function I can not use control propetries. I want to use index of ImageButton which is clicked and ImageURL...
3
by: =?Utf-8?B?UnVkeQ==?= | last post by:
Hello All! I may have posted this problem before, but it was awhile ago. I'm working in VS 2003. I have 10 file watch process going. It seems that I can only about 6or 7 to run at the same...
2
by: laxmibokka | last post by:
here im trying to create imagebuttons dynamically, and on click of button, the delete function should be called. actually commandargument is not passed into the imgBtn_Click im not getting any...
1
by: Mick Walker | last post by:
Hi everyone, I hope you all had a great weekend. I have a problem, and I am really not sur eon how I should address it; I have a repeater control, which is bound to a SqlDataSource, however within...
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: 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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.