В чем может быть проблема, что атрибуты аннотации данных не отображаются?
web.config
<appSettings>
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
C #
public class SearchCriteria
{
[Required]
public string ControlNo { get; set; }
[Required]
public string Insured { get; set; }
[Required]
public string PolicyNumber { get; set; }
}
ASCX
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Core.SearchCriteria>" %>
<%@ Import Namespace="Core" %>
<% using (Html.BeginForm()) {%>
<%= Html.ValidationSummary(true) %>
<fieldset>
<legend>Fields</legend>
<div class="editor-label">
<%= Html.LabelFor(model => model.ControlNo) %>
</div>
<div class="editor-field">
<%= Html.TextBoxFor(model => model.ControlNo) %>
<%= Html.ValidationMessageFor(model => model.ControlNo) %>
</div>
<div class="editor-label">
<%= Html.LabelFor(model => model.Insured) %>
</div>
<div class="editor-field">
<%= Html.TextBoxFor(model => model.Insured) %>
<%= Html.ValidationMessageFor(model => model.Insured) %>
</div>