Hi I want to call the corresponding html inside a Panel in code behind. How can I do that?
I have this
<asp:Panel ID="MyPanel" runat="server">
// other asp.net controls and html stuffs here.
</asp:Panel>
I want to get the HTML equivalent of MyPanel and all of its contents in my code behind say in PageLoad or some methods.
Thanks.
Does RenderControl() not work?
Create an instance of your control and then call RenderControl() on it. Of course this implies that your panel is in a UserControl
example from comments: