title: Manually add validation to textbox without a model
body: <p>I have a single textbox in a form that I would like to add some validation to.</p>
  
  <p>How can I add some unobtrusive validation attributes to it without using a model?</p>
  
  <p>For eg.</p>
  
  <pre><code>    @using (Html.BeginForm())
      {
          @Html.ValidationSummary()
          @Html.Label("code", "Confirmation Code") 
          @Html.TextBox("code")&lt;!-- I want validation on this thing --&gt;
          &lt;input type="submit" value="Go" /&gt;
      }   
  </code></pre>
  
  <p>How can I make it <code>required</code>, and others such as stringlength, etc.</p>