I'm writing the below code to get the html of a div element:
var sb = new StringBuilder();
MyDiv.RenderControl(new HtmlTextWriter(new StringWriter(sb)));
string s = sb.ToString();
Session["RecoveryItems"] = s;
But it throws the error:
Textbox controls must be inside a form tag.
I'm using master page with form tag and inside the aspx page i have a user control which contains the div. The div is populated with server code. with table, label control and textbox. I tried adding form tag inside the user control before the div
The div element must be inside the form control. Create the div server control in the aspx page and give it an id="someid" and runat="server" attribute and then try adding the textbox to that Div server control