[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

microsoft.public.dotnet.framework.aspnet.buildingcontrols

Executing and rendering user controls via LoadControl and RenderControl

Deane

9/3/2007 8:47:00 PM

I am rendering a user control manually using "LoadControl" and
"RenderControl" to get the results of the control (the HTML) back as a
string. The control is never added to the Page's Controls collection.

This is causing all kinds of problems with child controls of the
control I'm rendering manually. Those child controls may have code in
their Page_Load events (which doesn't fire), and -- additionally --
the RenderControl method doesn't seem to cause child controls to
render themselves.

I need to be able to execute a control in a "sandbox," so to speak. I
need an execution space that will render all child controls, fire all
events, etc. just as if the control was in Page's Controls
collection. But I need to get the resulting HTML back as a string.

How possible is this?