Instead of always displaying all validation errors, the
option to display only model-level errors. This enables model-level errors to be displayed in the validation summary and field-specific errors to be displayed next to each field.<%@ Page Title="" Language="C#" MasterPageFile="/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MvcApplication1.Models.Product>" %><asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> <title>Create</title></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <h2>Create</h2> <@= Html.ValidationSummary() @> <@ using (Html.BeginForm()) {> <fieldset> <legend>Fields</legend> <p> <label for="Name">Name:</label> <@ Html.TextBox("Name") %> <@ Html.ValidationMessage("Name", "*") > </p> </p> </fieldset> @ } <div> <@Html.ActionLink("Back to List", "Index") > </div></asp:Content>
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: