If I create a UserControl and add some objects to it, how can I grab the HTML it would render?
ex.
UserControl myControl = new UserControl();
myContr
override the RenderControl method
protected override void Render(HtmlTextWriter output)
{
output.Write("<br>Message from Control : " + Message);
output.Write("Showing Custom controls created in reverse" +
"order");
// Render Controls.
RenderChildren(output);
}
This will give you access to the writer which the HTML will be written to.
You may also want to look into the adaptive control architecture of asp.net adaptive control architecture of asp.net where you can 'shape' the default html output from controls.