It doesn't remove everything inside the 2nd form tag but just hides the and tags from the page
Any ideas and workaround?
Yes, it can be done - by creating a custom HtmlForm object and toggling the forms as needed. I've just answered a similar question here (with code):
ASP.NET Web Forms technology doesn't allow more than one <form> tags with runat=“server” on a single Web Form page.
Every form must be enclosed within a FORM element. There can be several forms in a single document, but the FORM element can't be nested.
All server controls must appear within a <form> tag, and the <form> tag must contain the runat="server" attribute.
Nesting of forms is not allowed in html. So you cant add another form inside the server-form.
But it is perfectly legal in ASP.NET to add get-forms outside of the server form.
I moved the nested form outside to solve this issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With