1

I'm using the technique described here to render a User Control to a string and it all works fine when the control contains just plain HTML, but when I try adding some server controls to the UC (like asp:button) I get the following error when calling server.execute:

"Error executing child request for handler 'System.Web.UI.Page'."

any ideas why/how to fix it? thanks.

1
  • Attach Visual Studio to the w3wp.exe process and break on all managed exceptions (ctrl-alt-e). This would give you (and us) more information about stack trace and error messages. Commented Jul 8, 2009 at 9:05

2 Answers 2

1

The problem was that the UC should have been added to the form's control collection, not the page's.

Sign up to request clarification or add additional context in comments.

Comments

0

Could you try to include a call to EnsureChildControls() before to render to a string. This way you force the page to render the entire control tree first.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.