我的视图中有一个 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; }
我遇到的问题是,我可以看到两次字符串长度验证错误。可能是什么问题?