标签:style blog io ar 使用 sp for on 2014
mvc中使用remote属性来做ajax验证比较容易 :[Remote("Action", "Controller", AdditionalFields = "Currency")] public decimal Amount {get; set;}
<input class="form-control" data-val="true" data-val-number="字段金额必须为数字" data-val-range="取款金额范围在100.00和10000.00之间。" data-val-range-max="10000.00" data-val-range-min="100.00" data-val-remote="‘金额‘ is invalid." data-val-remote-additionalfields="*.Amount,*.Currency" data-val-remote-url="/XXX/YYY" data-val-required="请输入金额。" id="Amount" name="Amount" type="text" value="0">
@Html.TextBoxFor(i => i.Amount, new { @class = "form-control", data_val_remote_additionalfields = "*.Amount,*.Currency", data_val_remote_url = Url.Action("Action","Controller"), })
标签:style blog io ar 使用 sp for on 2014
原文地址:http://blog.csdn.net/lan_liang/article/details/41074167