在MVC 4中需要像CompareValidator一样在View中查看From To To Values To To Value是否大于From Value?
型号:
[Required(ErrorMessage = "Please Enter From")]
public int FROM_RECORDVALUE { get; set; }
[Required(ErrorMessage = "Please Enter To")]
public int TO_RECORDVALUE { get; set; }
查看:
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label class="defaultlable">
@Model.getPickListMaster().getPickListHeaderName("RECORDVALUE") From
</label>
@Html.TextBoxFor(model => model.FROM_RECORDVALUE, new { @class = "form-control", @maxlength = @Model.getPickListMaster().MAX_LENGTH })
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label class="defaultlable">
@Model.getPickListMaster().getPickListHeaderName("RECORDVALUE") To
</label>
@Html.TextBoxFor(model => model.TO_RECORDVALUE,new { @class = "form-control", @maxlength = @Model.getPickListMaster().MAX_LENGTH})
</div>
</div>
</div>
我怎样才能实现这一目标?请给我一些建议。