Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Event of dynamic control

Reply
Thread Tools

Event of dynamic control

 
 
Frank Schumacher
Guest
Posts: n/a
 
      11-25-2004
Hi NG,

I add some ImageButtons to an user control, using the placeholder object
as a container. I like to get the clickevent from that button so i added
a method to the click property:
myIB.Click += new
System.Web.UI.ImageClickEventHandler(this.ImageBut tonHier_Click);

where ImageButtonHier_Click is my event handling method.

The code compiles, but when I click the button, no event is fired.

Can anyone help me out?

Thanks in advance,
Frank
 
Reply With Quote
 
 
 
 
Karl Seguin
Guest
Posts: n/a
 
      11-25-2004
The event needs to be hooked up on postback...which means the control must
be created and added to your placeholder.

http://www.denisbauer.com/ASPNETCont...aceholder.aspx
Might be of use to you.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/


"Frank Schumacher" <(E-Mail Removed)-leipzig.de> wrote in message
news:(E-Mail Removed)...
> Hi NG,
>
> I add some ImageButtons to an user control, using the placeholder object
> as a container. I like to get the clickevent from that button so i added
> a method to the click property:
> myIB.Click += new
> System.Web.UI.ImageClickEventHandler(this.ImageBut tonHier_Click);
>
> where ImageButtonHier_Click is my event handling method.
>
> The code compiles, but when I click the button, no event is fired.
>
> Can anyone help me out?
>
> Thanks in advance,
> Frank



 
Reply With Quote
 
 
 
 
Frank Schumacher
Guest
Posts: n/a
 
      12-01-2004
Thanks for the reply Karl, after making sure that the page is created
again after postback (even if i don't need the uc anymore) my event has
fired.

Karl Seguin wrote:
> The event needs to be hooked up on postback...which means the control must
> be created and added to your placeholder.
>
> http://www.denisbauer.com/ASPNETCont...aceholder.aspx
> Might be of use to you.
>
> Karl
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
placement of dynamic control depends on VALUE of dynamic control Larry Bud ASP .Net 1 01-10-2007 10:07 PM
edit attribute values of a web control just before control rendered to the page (control's Load event?) TJ ASP .Net Web Controls 4 04-07-2006 01:30 AM
How do I add a dynamic conection to a dynamic Webpart on the same event. arthernan ASP .Net 0 03-10-2006 05:54 PM
Dynamic control on aspx page, dynamic location Chris Thunell ASP .Net 3 07-21-2004 04:52 PM
Make parent control event call child control event Tillman ASP .Net Web Controls 0 05-21-2004 08:56 PM



Advertisments