views:

247

answers:

1

If I have this code:

<% using (Html.BeginForm("CreateItem", "Item", FormMethod.Post, new { enctype = "multipart/form-data" })) { %> 
    <label for="ItemImage">Item Image:</label>
    Please use JPEG file format only.<br />
    <input type="file" name="file" />
    <%= Html.ValidationMessage("ItemImage", "*") %>
<% } %>

And I want to use MvcContrib to catch bug, how do I add html.validation on html.beginform?

A: 

Take a look at the "NerdDinner" sample application. They do validation in there.

If you can't find it then add a comment to this answer and I'll provide code.

griegs