Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Controls (http://www.velocityreviews.com/forums/f63-asp-net-web-controls.html)
-   -   Webcontrol containing a UserControl?? Problem ... (http://www.velocityreviews.com/forums/t772715-webcontrol-containing-a-usercontrol-problem.html)

CubeFish 02-21-2004 10:32 PM

Webcontrol containing a UserControl?? Problem ...
 
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";
Page.LoadControl(strPath);
UserControl objForm = (UserControl)Page.LoadControl(strPath);
this.Controls.Add(objForm);

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!!

CubeFish


All times are GMT. The time now is 10:15 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.