PC Review


Reply
Thread Tools Rate Thread

Events for dynamic controls

 
 
Tom
Guest
Posts: n/a
 
      12th Dec 2008
I have a user control that is presented in a listview. I'm creating
controls during load and overriding Render. My problem is:
If I am creating a new Button for each instance of this control - how can I
trap the click event?

I have a panel with the button in the aspx file. The button has onclick
defined and when I show the control during the Render I do
Panel.RenderControl(htmlWriter). When I click the button the debugger does
not break in the click event.

Thanks..>Tom


 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      12th Dec 2008
for control to take part of event handling they must be part of the
control tree, have the same id (as must its parents) on postback as
original render, created before onload, and have the event hookup done
by on onload.

you code does not do all of this, so you need to implement your own
event handling in the user control. see docs on building controls and
implementing event handling.

-- bruce (sqlwork.com)

Tom wrote:
> I have a user control that is presented in a listview. I'm creating
> controls during load and overriding Render. My problem is:
> If I am creating a new Button for each instance of this control - how can I
> trap the click event?
>
> I have a panel with the button in the aspx file. The button has onclick
> defined and when I show the control during the Render I do
> Panel.RenderControl(htmlWriter). When I click the button the debugger does
> not break in the click event.
>
> Thanks..>Tom
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
events that fire events that fire events....a bad thing? Daniel Microsoft C# .NET 3 1st Feb 2007 02:55 AM
Dynamic Controls created by Dynamic Controls Ronald Microsoft ASP .NET 2 17th Jan 2006 01:44 AM
order of events - dynamic checkbox events =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?= Microsoft ASP .NET 0 17th Aug 2005 11:36 PM
Dynamic Events from Dynamic Controls on a User Control - Guess What? Broken! mytestemailaccount@gmail.com Microsoft ASP .NET 5 23rd Mar 2005 06:06 PM
URGENT: Dynamic controls and dynamic events Mustafa Rabie Microsoft C# .NET 0 22nd Jul 2004 11:35 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:35 PM.