Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Webcontrol containing a UserControl?? Problem ...

Thread Tools

Webcontrol containing a UserControl?? Problem ...

Posts: n/a
I am building a WebControl component that will implement a complete
message board system. So far so good and I am listing forums,
messages etc.

Now I am trying to embed various UserControls (forms for posting,
preview etc.) into the main WebControl. I am using the following code
during render:

Control objParent = Page.FindControl("objParent");
string strPath = m_strInstallDir + "/Forms/" + strObject + ".ascx";
UserControl objForm = (UserControl)Page.LoadControl(strPath);

This works fine and I am able to render the form into the control by
using RenderChildren() during rendering. Should I be adding the
control at some other point during initialization of the web control?

My problem is that all the OnClick events in the UserControl no longer
seem to work! The UserControl using codebehind with all the events in
the .CS file. How can I hook up all the events????

I also fail to get the any postback in the WebControl's
RaisePostBackEvent ...

Can anyone point me to a working sample of what I am trying to do?
Is it possible .. if so why can't I find any samples!!

Reply With Quote

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
Trapping an Exception ocurring in a Webcontrol at the Page or parent WebControl level. ASP .Net 2 01-31-2005 06:34 PM
WebControl inside of WebControl and attaching events Kasabaarde Sumta ASP .Net Building Controls 0 12-13-2004 09:51 PM
Can a webcontrol (webcontrol.dll) have a configuration file? Luis Ramírez. ASP .Net Building Controls 2 07-06-2004 04:35 PM
Webcontrol containing other controls issue (please, IMPORTANT!) Ivan Demkovitch ASP .Net 1 10-07-2003 08:16 PM
Webcontrol containing other controls issue (please, IMPORTANT!) Ivan Demkovitch ASP .Net Web Controls 1 10-07-2003 08:16 PM