Hi,
I'm creating 5 ImageButton controls in the panel control, and I have a
unique ID specified for each one.
When I click on any one of them, the Page_Load executes (Of course), but how
do I know which ImageButton caused the post back ? Does it get handled in
the Page_Load or do I need to create a new event handler ?
Thanks,
Steve 6 1194
If I understand you correctly, you would want to create an Event Handler. I
am just not sure what you meant by a "new" Event Handler.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Steve Caliendo" <sc*******@epion.com> wrote in message
news:#w**************@TK2MSFTNGP10.phx.gbl... Hi,
I'm creating 5 ImageButton controls in the panel control, and I have a unique ID specified for each one.
When I click on any one of them, the Page_Load executes (Of course), but
how do I know which ImageButton caused the post back ? Does it get handled in the Page_Load or do I need to create a new event handler ?
Thanks,
Steve
Ok, I tried adding this event handler and it doesn't fire when I click one
of the image buttons.
Private Sub ImageButton_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
stop
end sub
Do you know what I'm doing wrong ?
Steve
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl... If I understand you correctly, you would want to create an Event Handler.
I am just not sure what you meant by a "new" Event Handler.
-- HTH, Kevin Spencer .Net Developer Microsoft MVP Big things are made up of lots of little things.
"Steve Caliendo" <sc*******@epion.com> wrote in message news:#w**************@TK2MSFTNGP10.phx.gbl... Hi,
I'm creating 5 ImageButton controls in the panel control, and I have a unique ID specified for each one.
When I click on any one of them, the Page_Load executes (Of course), but how do I know which ImageButton caused the post back ? Does it get handled
in the Page_Load or do I need to create a new event handler ?
Thanks,
Steve
ok this works for me
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim imgbtn As New ImageButton
imgbtn.ID = "myimagebtn"
imgbtn.ForeColor = System.Drawing.Color.Azure
imgbtn.Visible = True
form1.Controls.Add(imgbtn)
AddHandler CType(Page.FindControl("myimagebtn"),
ImageButton).Click, AddressOf ImageButtonClick
End Sub
Private Sub ImageButtonClick(ByVal sender As Object, ByVal e As
ImageClickEventArgs)
End Sub
hth
-ashish
Steve Caliendo wrote: Ok, I tried adding this event handler and it doesn't fire when I click one of the image buttons.
Private Sub ImageButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
stop
end sub
Do you know what I'm doing wrong ?
Steve
"Kevin Spencer" <ks******@takempis.com> wrote in message news:%2***************@tk2msftngp13.phx.gbl...
If I understand you correctly, you would want to create an Event Handler.
I
am just not sure what you meant by a "new" Event Handler.
-- HTH, Kevin Spencer .Net Developer Microsoft MVP Big things are made up of lots of little things.
"Steve Caliendo" <sc*******@epion.com> wrote in message news:#w**************@TK2MSFTNGP10.phx.gbl...
Hi,
I'm creating 5 ImageButton controls in the panel control, and I have a unique ID specified for each one.
When I click on any one of them, the Page_Load executes (Of course), but
how
do I know which ImageButton caused the post back ? Does it get handled in the Page_Load or do I need to create a new event handler ?
Thanks,
Steve
You have to wire up the Event Handler to the object's event, using An
AddHandler statement. Example:
AddHandler Button1.Click, ImageButton_Click
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Steve Caliendo" <sc*******@epion.com> wrote in message
news:#N**************@tk2msftngp13.phx.gbl... Ok, I tried adding this event handler and it doesn't fire when I click one of the image buttons.
Private Sub ImageButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
stop
end sub
Do you know what I'm doing wrong ?
Steve
"Kevin Spencer" <ks******@takempis.com> wrote in message news:%2***************@tk2msftngp13.phx.gbl... If I understand you correctly, you would want to create an Event
Handler. I am just not sure what you meant by a "new" Event Handler.
-- HTH, Kevin Spencer .Net Developer Microsoft MVP Big things are made up of lots of little things.
"Steve Caliendo" <sc*******@epion.com> wrote in message news:#w**************@TK2MSFTNGP10.phx.gbl... Hi,
I'm creating 5 ImageButton controls in the panel control, and I have a unique ID specified for each one.
When I click on any one of them, the Page_Load executes (Of course),
but how do I know which ImageButton caused the post back ? Does it get
handled in the Page_Load or do I need to create a new event handler ?
Thanks,
Steve
Hey guys,
but what about child controls? I am having the same problem. I created a web
custom control that will basically draw a table with some controls inside.
One of those controls is a command button. I can't get the Onclick event of
this command button to fire. How does it work for child controls?
Thanks!
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:ed**************@TK2MSFTNGP10.phx.gbl... You have to wire up the Event Handler to the object's event, using An AddHandler statement. Example:
AddHandler Button1.Click, ImageButton_Click
-- HTH, Kevin Spencer .Net Developer Microsoft MVP Big things are made up of lots of little things.
"Steve Caliendo" <sc*******@epion.com> wrote in message news:#N**************@tk2msftngp13.phx.gbl... Ok, I tried adding this event handler and it doesn't fire when I click
one of the image buttons.
Private Sub ImageButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
stop
end sub
Do you know what I'm doing wrong ?
Steve
"Kevin Spencer" <ks******@takempis.com> wrote in message news:%2***************@tk2msftngp13.phx.gbl... If I understand you correctly, you would want to create an Event Handler. I am just not sure what you meant by a "new" Event Handler.
-- HTH, Kevin Spencer .Net Developer Microsoft MVP Big things are made up of lots of little things.
"Steve Caliendo" <sc*******@epion.com> wrote in message news:#w**************@TK2MSFTNGP10.phx.gbl... > Hi, > > I'm creating 5 ImageButton controls in the panel control, and I have
a > unique ID specified for each one. > > When I click on any one of them, the Page_Load executes (Of course), but how > do I know which ImageButton caused the post back ? Does it get
handled in > the Page_Load or do I need to create a new event handler ? > > Thanks, > > Steve > >
Hi Juan,
Well, you're talking about a somewhat different scenario here, as the
original question was about handling the events fired by dynamically-added
Controls in an ASPX Page. However, there are some similarities (a Page is a
Control, and the child Controls of a Page are just that: Child Controls). In
any case, the basic principle is the same. In the case of a Page with
dynamically-added Child Controls, you have to wire up an event handler in
the Page to handle the event fired by the Child Control. In a custom Server
Control, you must do essentially the same thing. The following .Net SDK
article should be helpful: http://msdn.microsoft.com/library/en...asp?frame=true
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Juan Romero" <ju*********@bowne.com> wrote in message
news:uD**************@TK2MSFTNGP09.phx.gbl... Hey guys,
but what about child controls? I am having the same problem. I created a
web custom control that will basically draw a table with some controls inside. One of those controls is a command button. I can't get the Onclick event
of this command button to fire. How does it work for child controls?
Thanks!
"Kevin Spencer" <ks******@takempis.com> wrote in message news:ed**************@TK2MSFTNGP10.phx.gbl... You have to wire up the Event Handler to the object's event, using An AddHandler statement. Example:
AddHandler Button1.Click, ImageButton_Click
-- HTH, Kevin Spencer .Net Developer Microsoft MVP Big things are made up of lots of little things.
"Steve Caliendo" <sc*******@epion.com> wrote in message news:#N**************@tk2msftngp13.phx.gbl... Ok, I tried adding this event handler and it doesn't fire when I click one of the image buttons.
Private Sub ImageButton_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs)
stop
end sub
Do you know what I'm doing wrong ?
Steve
"Kevin Spencer" <ks******@takempis.com> wrote in message news:%2***************@tk2msftngp13.phx.gbl... > If I understand you correctly, you would want to create an Event Handler. I > am just not sure what you meant by a "new" Event Handler. > > -- > HTH, > Kevin Spencer > .Net Developer > Microsoft MVP > Big things are made up > of lots of little things. > > "Steve Caliendo" <sc*******@epion.com> wrote in message > news:#w**************@TK2MSFTNGP10.phx.gbl... > > Hi, > > > > I'm creating 5 ImageButton controls in the panel control, and I
have a > > unique ID specified for each one. > > > > When I click on any one of them, the Page_Load executes (Of
course), but > how > > do I know which ImageButton caused the post back ? Does it get handled in > > the Page_Load or do I need to create a new event handler ? > > > > Thanks, > > > > Steve > > > > > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Ashish Shridharan |
last post by:
Hi All
I have been trying to add a control to the header cell of
a datagrid on my ASP.NET page. These controls are defined
in the HTML as ASP.NET web controls.
They are being added into the...
|
by: Makarand |
last post by:
Hi Friends
I am having problem in Event handling in ASP.NET.
Let me tell you what I am doing, I have having DataGrid
for which I am using 'Dynamic addition of Template
controls'. For this I...
|
by: Steve Caliendo |
last post by:
Hi,
I'm creating 5 ImageButton controls in the panel control, and I have a
unique ID specified for each one.
When I click on any one of them, the Page_Load executes (Of course), but how
do I...
|
by: Paul Johnson |
last post by:
I have problems with eventhandlers when dynamically moving controls in
ASP.NET.
The controls are loaded into a placeholder on postback so that the
eventhadlers can fire. If a move evet or...
|
by: Sridhar |
last post by:
Hi,
I have created a web page which includes a place holder. I also have a
dropdown list in that webpage. when I select one of the choices in that
dropdown list, It will load a user control...
|
by: Marcelo Cabrera |
last post by:
Hi,
I have a user control that in turn creates a bunch of webcontrols
dynamically and handles the events these webcontrols raise. It used to work
fine on ASP .Net 1.1 but when compiled on 2.0 it...
|
by: WolfyUK |
last post by:
Hello,
I have a standard asp:DataGrid called CasesGrid that I wish to write my
own paging controls for. The aim is to get something like the following
rendered to screen:
<< First < Previous...
|
by: Hellogeetu |
last post by:
Hi All,
I am creating dynamic controls but not on page_load event but on one of the button click event.
I m able to get the controls value by using request.form but i m unable to handle the...
|
by: MaryamSh |
last post by:
Hi,
I am creating a Dynamic Search in my application.
I create a user control and in Page_load event I create a dynamic dropdownlist and 2 dynamic button (Add,Remove)
By pressing Add button...
|
by: MaryamSh |
last post by:
Create Dynamic Dropdownlist Controls and related event
--------------------------------------------------------------------------------
Hi,
I am creating a Dynamic Search in my application.
I...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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,...
|
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...
| |