title: Alternatives to server controls in MVC
body: <p>What is the replacement for a server control in ASP.NET MVC? What I want to do is to create a declarative and imperative binding so I can write</p>
  
  <pre><code>&lt;cc1:MyControl Header="Some Header" Content="Some Content" /&gt;
  </code></pre>
  
  <p>which would mean that an instance of the MyControl class will be created and possibly rendered to</p>
  
  <pre><code>&lt;h1&gt;Some Header&lt;/h1&gt;
  &lt;p&gt;Content&lt;/p&gt;
  </code></pre>
  
  <p>I don't want any viewstate or postback crap, just the modularity. I also want these modules to be contained in a separate class library, so ViewUserControls will not do for me. Using a server controls in the normal way works, but it generates a form tag and a viewstate field, which I do not want if I can avoid it.</p>
  
  <p>I have seen <a href="https://stackoverflow.com/questions/317995/server-controls-and-mvc">this question</a> and <a href="https://stackoverflow.com/questions/264664/server-controls-in-asp-net-mvc">this one</a> about how to use server controls in ASP.NET MVC, but they do not provide enough answer.</p>
  
  <p><strong>Edit:</strong> I found the answer. When I added the user control using the designer, it automatically created a &lt;form&gt; which I missed. If I simply remove that tag, everything works perfectly.</p>