当通过 ajax 调用检索以下代码时,不会将验证器写入视图。可以将任意数量的这些部分视图添加到页面中,并且文本框会获得一个日期选择器,这就是生成唯一 ID 的原因。我当然感谢任何帮助.vie
@using Nautilus.Core.Model.Enumeration
@using Nautilus.Web.Models
@using Nautilus.Web.Views.Tools
@model IntensityHistoryModel
<tr>
<td class='removeIntensityScore' title='Click to remove this item.'></td>
<td>
<span></span>
</td>
<td>
@Html.ValidationMessageFor(m => m.IntensityDateGUID)
@Html.TextBoxFor(m => m.IntensityDate, new { id = Model.IntensityDateGUID, @class = "intensityScoreDate", style = "width:120px" })
</td>
<td>
@Html.DropDownList("IntensityScore", ViewHelper.GetSelectListWithDescriptionFromEnum<IntensityScore.Values>("", new[] { "0" }), " -- Select -- ", new { style = "width:150px;margin:0" })
</td>
</tr>