我想对多个文本字段进行验证
值必须介于0和@ ViewBag.MaxNote
之间在视图中我有以下内容:
@model IList<RolesMVC3.Models.STUDENTS>
<P>Please enter a value between 0 and : @ViewBag.MaxNote<P>
@using (Html.BeginForm(null, null, FormMethod.Post, new { id = "myForm" }))
{
@Html.ValidationSummary(true)
@for (var i = 0; i < Model.Count(); i++)
{
@Html.TextBox("txt")
}
<input type="submit" value="type="submit" class="btn btn-primary" />
}
我必须根据&#34; @ ViewBag.MaxNote&#34;
的值来验证字段我怎么能这样做?