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