title: LinkButton in ASP.NET MVC
body: <p>I need to instantiate some ASP LinkButtons onto an ASP.NET MVC view page.  I've tried a few things, and I cant get them to come out right.  Heres my most recent incarnation of the code:
  the aspx file</p>
  
  <pre><code>&lt;body&gt;
  &lt;% using (Html.BeginForm("TitleDetail", "Movies", FormMethod.Post, new{runat="server"})) { %&gt; 
  
      &lt;ul&gt;
      &lt;% foreach (var disc in Model.Title.tblDiscs) %&gt;
      &lt;% { %&gt;
  
          &lt;li&gt;
              &lt;asp:LinkButton ID="Play"&gt;Link&lt;/asp:LinkButton&gt;
          &lt;/li&gt;
      &lt;% } %&gt;
      &lt;/ul&gt;
  &lt;% } %&gt; 
  &lt;/body&gt;
  </code></pre>
  
  <p>What it renders in Firefox is one instance of the text Link for each member in the collection I'm enumerating, but they arent hyperlinks, just text.
  The generated HTML looks like this</p>
  
  <pre><code>&lt;form action="/MyMovies/TitleDetail/239" method="post" runat="server"&gt;test title &lt;br /&gt;
  
     &lt;ul&gt;
          &lt;li&gt;
  
              &lt;asp:LinkButton ID="Play"&gt;Link&lt;/asp:LinkButton&gt;
          &lt;/li&gt;
  
          &lt;li&gt;
              &lt;asp:LinkButton ID="Play"&gt;Link&lt;/asp:LinkButton&gt;
          &lt;/li&gt;
  
          &lt;li&gt;
              &lt;asp:LinkButton ID="Play"&gt;Link&lt;/asp:LinkButton&gt;
  
          &lt;/li&gt;
  
      &lt;/ul&gt;
  </code></pre>
  
  <p> </p>
  
  <p>I've tried adding a runat="server" attribuite to each asp:LinkButton tag, but I get a runtime exception that  controls can only be put inside a form tag with the runat="server" attribute.  Which I think I've already done, so I dont really understand that.  Can anyone explain to me what I'm doing wrong, and what I need to do to fix it so that the LinkButtons are actually linky?</p>