我的视图中有一个aspx页面,它调用了局部视图,
using (Html.BeginForm("Edit", "MyReport", FormMethod.Post, new { name = "myform", autocomplete = "off" }))
{%>
<%
Html.RenderPartial("_Form");%>
<% } %>
部分视图
<div>
<%=Html.ValidationSummary()%>
</div>
<div class="fieldRow">
<span class="fieldCell threeCol">
<label for="schedule.SavedReportName">
Name<span class="requiredField">*</span>
</label>
<%=Html.TextBox("schedule.SavedReportName", ViewData.Model.SavedReportName, new {style = "width:516px;"})%>
</span>
</div>
我的模型具有此属性
[Required(ErrorMessage = "Name is required.")]
[StringLength(60, ErrorMessage = "Maximum 60")]
public string SavedReportName { get; set; }
我遇到的问题是,我能够看到两次字符串长度验证错误。 可能是什么问题?