Search code examples
asp.netsemanticssemantic-markuprunatserver

Is it semantically valid to wrap all page's tags inside the form tag - ASP.net


I am not new to ASP.net. Actually, I am not even learning it. But, I was recently evaluating some Web sites and saw that awful <form runat="server" ..> that wraps the whole page and contains all other tags. The question: Is that valid HTML? It is 2012 and talks about semantic Web, accessible Web, etc. is hot. What do you think of it?


Solution

  • It is syntax-wise valid HTML. But I agree it's a bit 'outdated' a form and some hidden fields, etc. as ViewState. Also it can be quite cumbersome to work when you want to use more forms on the page (using JQuery f.i.).

    Take a look at ASP.Net MVC, it solves the problem. You have full control over the HTML and does not need a form tag around the page. It does not use asp.net server controls.