Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC RC2 - Why can't I use the normal validation options? e.g. RequiredFieldValidator

Tags:

I'm trying to validate a basic form, can i not use the standard validation controls? Everywhere i'm looking seems to try and use something like the below

<%= Html.ValidationSummary() %>

<% using (Html.BeginForm()) {%>

    <fieldset class="fields">
        <legend>Create New Contact</legend>
        <p>
            <label for="task">Task Name:</label>
            <%= Html.TextBox("task") %>
            <%= Html.ValidationMessage("task", "*") %>
        </p>
        <p class="submit">
            <input type="submit" value="Create" />
        </p>
    </fieldset>

<% } %>

I thought id be able to use the standard components? Any pointers would be brilliant!


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!