Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Executing and rendering user controls via LoadControl and RenderControl

Thread Tools

Executing and rendering user controls via LoadControl and RenderControl

Posts: n/a
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?

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
RenderControl with Sub Controls. Nigil ASP .Net 2 01-14-2008 04:48 PM
Some controls cannot RenderControl Josh Carver ASP .Net 2 07-10-2007 12:18 PM
TreeView in Custom User Control RenderControl error ASP .Net 0 11-07-2006 06:37 PM
User controls and LoadControl method J055 ASP .Net Web Controls 1 10-05-2006 07:10 AM
RenderControl and Web User Controls charles ASP .Net 0 10-09-2004 01:48 AM