473,569 Members | 2,402 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

capture click event of multiple image buttons

HI Group!

I have to programmaticall y create a user input form with various Checkbox
and RadioButton lists - Beside every List I have to place an image button
that is able to reset the checkboxlists and radiobutton lists.

if i declare a variable with

private withEvents img as ImageButton

and have a sub with..

Protected Sub Click1(ByVal sender As Object, ByVal e As
System.Web.UI.I mageClickEventA rgs) _

Handles img.Click

msgbox("test")

End Sub

My Code for examle iterates 2 times but only one event is captured. So how
can I assure that every event of my buttons (could be 20 or more) is
captured. I would need to reset the value of specific controls with that
code!

Many thanks in advance!

best regards

andy
Mar 24 '07 #1
3 2449
If I read you correctly, you are attempting to set radiobuttons or
checkboxlist items with image buttons, giving the user two ways to set the
selected value(s). If so, let's forget the radiobuttonlist for a moment, as
only one radio button can be checked at any one time, making it the easier
problem to solve.

You can wire all buttons to the same click event. I do not know the VB
syntax to have multiple controls hit the same event, but it is the addition
of a simple delegate assingment in C#. You can easily do this dynamically,
so the buttons will be wired without having to know how many there are. You
then determine which button sets which checkbox, but this is done as you
render the list, so it is not difficult.

When a button is clicked, you call a separate routine that runs through all
of the checkboxes and determines which are checked and which are not. Make
it a separate routine, for reuse. You will call the same routine when you
submit the form, for example.

Hope this helps.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** ***************
Think outside the box!
*************** *************** ***************
"Andreas Wöckl" <wo****@esys.at wrote in message
news:Oq******** ******@TK2MSFTN GP03.phx.gbl...
HI Group!

I have to programmaticall y create a user input form with various Checkbox
and RadioButton lists - Beside every List I have to place an image button
that is able to reset the checkboxlists and radiobutton lists.

if i declare a variable with

private withEvents img as ImageButton

and have a sub with..

Protected Sub Click1(ByVal sender As Object, ByVal e As
System.Web.UI.I mageClickEventA rgs) _

Handles img.Click

msgbox("test")

End Sub

My Code for examle iterates 2 times but only one event is captured. So how
can I assure that every event of my buttons (could be 20 or more) is
captured. I would need to reset the value of specific controls with that
code!

Many thanks in advance!

best regards

andy

Mar 24 '07 #2
HI Gregory!

Unfortunately I am a beginner in developing .Net. Do you have some Code for
me to wire all buttons to the same click event? Do I have to define a
variable like

protected withEvents img ImageButton

at the beginning of the class?

My goal is to RESET the values of checkbox or radiobutton lists - not to
set -just to put away the values!

best regards

andy
"Cowboy (Gregory A. Beamer)" <No************ @comcast.netNoS pamMschrieb im
Newsbeitrag news:C3******** *************** ***********@mic rosoft.com...
If I read you correctly, you are attempting to set radiobuttons or
checkboxlist items with image buttons, giving the user two ways to set the
selected value(s). If so, let's forget the radiobuttonlist for a moment,
as only one radio button can be checked at any one time, making it the
easier problem to solve.

You can wire all buttons to the same click event. I do not know the VB
syntax to have multiple controls hit the same event, but it is the
addition of a simple delegate assingment in C#. You can easily do this
dynamically, so the buttons will be wired without having to know how many
there are. You then determine which button sets which checkbox, but this
is done as you render the list, so it is not difficult.

When a button is clicked, you call a separate routine that runs through
all of the checkboxes and determines which are checked and which are not.
Make it a separate routine, for reuse. You will call the same routine when
you submit the form, for example.

Hope this helps.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** ***************
Think outside the box!
*************** *************** ***************
"Andreas Wöckl" <wo****@esys.at wrote in message
news:Oq******** ******@TK2MSFTN GP03.phx.gbl...
>HI Group!

I have to programmaticall y create a user input form with various Checkbox
and RadioButton lists - Beside every List I have to place an image button
that is able to reset the checkboxlists and radiobutton lists.

if i declare a variable with

private withEvents img as ImageButton

and have a sub with..

Protected Sub Click1(ByVal sender As Object, ByVal e As
System.Web.UI. ImageClickEvent Args) _

Handles img.Click

msgbox("test ")

End Sub

My Code for examle iterates 2 times but only one event is captured. So
how can I assure that every event of my buttons (could be 20 or more) is
captured. I would need to reset the value of specific controls with that
code!

Many thanks in advance!

best regards

andy


Mar 25 '07 #3
VB.NET or C#?

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** ***************
Think outside the box!
*************** *************** ***************
"Andreas Wöckl" <wo****@esys.at wrote in message
news:e0******** ******@TK2MSFTN GP04.phx.gbl...
HI Gregory!

Unfortunately I am a beginner in developing .Net. Do you have some Code
for me to wire all buttons to the same click event? Do I have to define a
variable like

protected withEvents img ImageButton

at the beginning of the class?

My goal is to RESET the values of checkbox or radiobutton lists - not to
set -just to put away the values!

best regards

andy
"Cowboy (Gregory A. Beamer)" <No************ @comcast.netNoS pamMschrieb
im Newsbeitrag news:C3******** *************** ***********@mic rosoft.com...
>If I read you correctly, you are attempting to set radiobuttons or
checkboxlist items with image buttons, giving the user two ways to set
the selected value(s). If so, let's forget the radiobuttonlist for a
moment, as only one radio button can be checked at any one time, making
it the easier problem to solve.

You can wire all buttons to the same click event. I do not know the VB
syntax to have multiple controls hit the same event, but it is the
addition of a simple delegate assingment in C#. You can easily do this
dynamically, so the buttons will be wired without having to know how many
there are. You then determine which button sets which checkbox, but this
is done as you render the list, so it is not difficult.

When a button is clicked, you call a separate routine that runs through
all of the checkboxes and determines which are checked and which are not.
Make it a separate routine, for reuse. You will call the same routine
when you submit the form, for example.

Hope this helps.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************** *************** *************** *
Think outside the box!
************** *************** *************** *
"Andreas Wöckl" <wo****@esys.at wrote in message
news:Oq******* *******@TK2MSFT NGP03.phx.gbl.. .
>>HI Group!

I have to programmaticall y create a user input form with various
Checkbox and RadioButton lists - Beside every List I have to place an
image button that is able to reset the checkboxlists and radiobutton
lists.

if i declare a variable with

private withEvents img as ImageButton

and have a sub with..

Protected Sub Click1(ByVal sender As Object, ByVal e As
System.Web.UI .ImageClickEven tArgs) _

Handles img.Click

msgbox("test" )

End Sub

My Code for examle iterates 2 times but only one event is captured. So
how can I assure that every event of my buttons (could be 20 or more) is
captured. I would need to reset the value of specific controls with that
code!

Many thanks in advance!

best regards

andy


Mar 27 '07 #4

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

Similar topics

4
14703
by: Jay | last post by:
Hi, How can I capture mouse position on Image? I found number of script capturing mouse position of the page. But I could not find anything based on image. What I want to find out is X Y coordinates of mouse position. based on left of the top of my image is 0 0 (X Y coordinates) otherwise, I need to find out position of my image so I...
1
3080
by: Matthew Wieder | last post by:
Hi - I wanted to capture the enter button on a form since I have a datagrid with the first column being a delete button and if someone hits enter it deletes the first record. I coded: private void Page_Load(object sender, System.EventArgs e) { Page.RegisterHiddenField("__EVENTTARGET","SomeButtonOnThePage");
3
2794
by: Benjamin Gavin | last post by:
Hi all, I recently stumbled upon a bug in the ASP.NET framework handling of ImageButton based postbacks. The issues derives from the fact that IE and Mozilla handle the case of a missing image file differently. In both cases, the setup for the problem is: 1. Create a form with an ImageButton whose ImageURL is invalid, specify an...
3
13091
by: Mark | last post by:
This is a solution... Often users want to keep clicking "submit" when they are waiting for server processing. Most apps these days like to disable the submit button to prevent this. You can't just disable the button in the OnClick event in ASP.Net because then the Click event won't post to the server (because you disabled it). I searched...
5
3114
by: ewillyb | last post by:
Hi, ASP.NET has some interesting behavior when the user hits the Enter key. If there are multiple ASP:Buttons (rendered as HTML submits) on the form, when the user hits enter, the first button's click event will fire and the page will submit. I have a series of pages with Previous and Next navigational Btns. The Previous button is the...
0
1493
by: Oddball | last post by:
I have set up a page with uses two lots of image buttons, one for a collection and one for more images from that collection. I generate all the image buttons on page init (I know, but I implemented that as part of trying to solve this already existant problem). The CollectionItemButton_Click event will fire, but the MoreImagesButton_Click...
2
3860
by: mark | last post by:
Is there a means of raising an event when ANY button on a windows application form is clicked wherein the actual button clicked can be determined in the generic click events code (eg by way of interogating the sender)? -- mark
5
2443
by: mayur_hirpara | last post by:
Hi, I have been developing web applications for a while now. However, as I was thinking through the architecture I really don't understand the "How server can identify between which buttons has made the postback request.???" for e.g. I have a webpage default.aspx. I place TWO or more server buttons on it. Create server-side event handlers...
2
1976
by: Bundy | last post by:
Hi On my webpages I have replaced the submit button with a rolling submit button using the script below (Script 1). This script is used by many of my webpages and is included in a external file. There are two webpages that use onSubmit event handler to fire a script in an external file but the event handler is no longer firing. onSubmit...
0
7703
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...
0
7618
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8138
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...
1
7679
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...
0
7983
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5514
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...
0
5223
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3657
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...
0
946
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...

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.