473,698 Members | 2,888 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with addHandler for ImageButton

3 New Member
Hi All,


I'm having a problem with a small bit of code:
Dim deleteButton = New System.Web.UI.W ebControls.Imag eButton
deleteButton.im ageURL = "images/icondelete.gif"
deleteButton.To olTip = "Delete Data Source"
deleteButton.Co mmandArgument = "Delete1"
AddHandler deleteButton.Cl ick, AddressOf DeleteDataSourc e_Click

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

deleteButton.To olTip = "Delete Data Source"
deleteButton.Co mmandArgument = "Delete1"
AddHandler deleteButton.Cl ick, AddressOf DeleteDataSourc e_Click

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

I look forward to your help :)

Uffe
Apr 1 '07 #1
5 2605
ugavnholt
3 New Member
I still haven't got any replies on this topic... so now it's bumped
Apr 2 '07 #2
Motoma
3,237 Recognized Expert Specialist
What kind of error messages do you receive?
Apr 2 '07 #3
ugavnholt
3 New Member
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.Ima geButton', or something like that...
Apr 3 '07 #4
Motoma
3,237 Recognized Expert Specialist
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.Ima geButton', 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
laxmibokka
7 New Member
try this way


AddHandler deleteButton.Co mmand, AddressOf DeleteDataSourc e_Click

private sub DeleteDataSourc e_Click(sender as object, e as System.Web.UI.W ebControls.Comm andEventArgs)
...... 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
8437
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 ImageButton during runtime, is fired. Any suggestions would be great. This code is the c# behind a webform with 1 panel and 2 buttons on it. I can see that the Page controls are correct after the event, but the page does not display it this way. ...
4
2917
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 some textboxes not updating when i a hit save. for example I have this code in my aspx.cs file: declared:
1
3137
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. After each ImageButton is created, I addhandler the ImageButton to the private sub, which gave me no error. But on the runtime, whenever the imagebutton is clicked, it seems like none
7
4014
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 = New ImageButton() LnkImage.ImageUrl = "~/printer.gif" LnkImage.ID = "ib" & oArray(1, id) AddHandler LnkImage.Command, AddressOf NewIbnCommandEvent()
3
1562
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 decrement to facilitate a movenext and movelast. I have been pulling my hair out and am at the end of my rope. PLEASE, how should I implement this? I have tried everything I can think of, which really isn't much considering I am just beginning...
2
2235
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 property. How to use this? protected void Page_Load(object sender, EventArgs e) { ImageButton HeaderImage = new ImageButton; for (int n = 1; n < 6; n++) {
3
1649
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 time. I made a test program to isolate the problem from my program. Still same thing Basicly I have one application creating a file, the other application running the file watch procces. When a file with a certain extension is created, then a form...
2
1672
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 errors but its not working plz help its very urgent thanx in advance
1
2291
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 the repeater control are a number of ImageButtons, and basically if the Data Item is empty of NULL then I wish the image on the button to be "cross.gif" otherwise I would like it to be "tick.gif". As I said before I really have never came...
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8904
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6531
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4372
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4624
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
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 we have to send another system
3
2007
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.