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

capture click event of multiple image buttons

HI Group!

I have to programmatically 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.ImageClickEventArgs) _

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 2442
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.atwrote in message
news:Oq**************@TK2MSFTNGP03.phx.gbl...
HI Group!

I have to programmatically 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.ImageClickEventArgs) _

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.netNoSpamMschrieb im
Newsbeitrag news:C3**********************************@microsof t.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.atwrote in message
news:Oq**************@TK2MSFTNGP03.phx.gbl...
>HI Group!

I have to programmatically 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.ImageClickEventArgs) _

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.atwrote in message
news:e0**************@TK2MSFTNGP04.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.netNoSpamMschrieb
im Newsbeitrag news:C3**********************************@microsof t.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.atwrote in message
news:Oq**************@TK2MSFTNGP03.phx.gbl...
>>HI Group!

I have to programmatically 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.ImageClickEventArgs) _

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
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...
1
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...
3
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...
3
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...
5
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...
0
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...
2
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...
5
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...
2
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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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...

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.