[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webcontrols

Webcontrol containing a UserControl?? Problem ...

cubefish

2/21/2004 10:32:00 PM

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