Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Click event wont fire...

Reply
Thread Tools

Click event wont fire...

 
 
Jim Weatherly
Guest
Posts: n/a
 
      08-07-2003
When adding controls dynamically, make sure the entire
object hierarchy gets rebuilt on postbacks. If the
objects don't get rebuilt because it is a postback,
ASP.Net can't find the event handler for the postback
event. Not sure if this is your issue but it has tripped
me up. In fact, I try to avoid dynamically creating
controls on pages. I would rather drop them on the page in
the designer and set the Visible property to false, and
make them visible from code when appropriate. That way
the controls are always present in the object hierarchy
for the page and event mapping is much easier. However,
the controls always get build when the page gets built, so
it is not without a cost.

>-----Original Message-----
>I have a user control (ascx). which creates dynamic

buttons. The buttons
>have one click event wired to it. I have to use a

placeholder to placeit. It
>works fine, but when i do embed it deep further in a
>table->row->cell.controls.add(button), the click event

never fires. Can
>anybody tell me if this is possible or a workaround is

possible.
>
>Rajesh
>
>
>.
>

 
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
When user press F5 after a button click event, the click event fires again! Max2006 ASP .Net 2 09-19-2007 05:37 AM
Wire up a click event within another click event doesn't work... Chu ASP .Net 2 04-10-2006 10:43 PM
image button click event fires before click event of button Purvi T ASP .Net 0 10-19-2004 06:19 AM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge ASP .Net Building Controls 1 05-28-2004 06:23 AM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge ASP .Net 2 05-25-2004 11:45 PM



Advertisments