Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Help: Control lost doesn't raise event after being moved to dynamically loaded user control

Reply
Thread Tools

Help: Control lost doesn't raise event after being moved to dynamically loaded user control

 
 
Thanh Nguyen
Guest
Posts: n/a
 
      04-01-2004
Hi everyone, I'm encountering a very weird problem, I have spent the
last 3 days trying to figure out how to fix but there is still no
clue. Here is the problem:

I define 2 WebUserControls:

- Content.ascx has a TabStrip control and a Button on it.

- Box.ascx has a PlaceHolder control on it.

In the OnInit() event handler, I create a table cell and dynamically
add the Box.ascx control to the table Cell using LoadControl() method.
Then I dynamically add the Content.ascx control to the PlaceHolder
inside the Box.ascx control.

When the webapp runs, clicking on the Button (in Content.ascx) does
raise the event, clicking on the TabStrip control (also in
Content.ascx) does NOT rise the event.

The weird thing is if I don't use LoadControl() but instead creating a
Panel control and add the Content.ascx to the Panel control then it
works fine.

It seems there is something wrong with dynamic control loading & the
PlaceHolder but I'm not sure

Could someone please help? Much appreciated!!!

Thanks
 
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
Re: Raise Event from Dynamically loaded Web User Control wfairl@gmail.com ASP .Net 1 12-15-2006 09:27 PM
Event fails to fire first time in dynamically loaded user control( =?Utf-8?B?U3RldmUgQm9vdGg=?= ASP .Net 6 04-06-2005 07:53 PM
Raise event when text or site is completely loaded Marc Bogaard Javascript 1 09-17-2004 08:24 AM
FWD: Help: Control lost doesn't raise event after being moved to dynamically loaded user control Tonix ASP .Net Web Controls 0 08-24-2004 05:42 AM
FWD: Help: Control lost doesn't raise event after being moved to dynamically loaded user control Tonix ASP .Net 0 08-24-2004 05:26 AM



Advertisments