在IIS上部署时,MVC验证不起作用

时间:2015-08-03 06:03:29

标签: validation asp.net-mvc-4 jquery-ui iis

我已经在IIS上部署了一个MVC项目但是没有一个验证在那里工作,而验证在localhost上运行正常。它显示错误.live()不是方法,然后我用Google搜索并替换{{1} } .live()所以现在错误没有显示,但验证仍然无法正常工作。请指导我解决这个问题。以下是我的示例查看代码

.on()

以下是Model

的代码
            <li>
                @Html.LabelFor(m => m.AccountName)
                @*@Html.DropDownListFor(x => x.AccountId, (ViewBag.AccountsList) as IEnumerable<SelectListItem>, new { @class = "", @style = "width:312px; height:31px;" })*@
                @Html.DropDownListFor(m => m.AccountId, (ViewBag.AccountsList) as IEnumerable<SelectListItem>, new { @Id = "AccountName", @class = "chosen-select", @style = "width:312px; height:31px; float: right;" })
                @Html.ValidationMessageFor(m => m.AccountId)



            </li>
            <li>
                @Html.LabelFor(m => m.ContactName)
                @Html.TextBoxFor(m => m.ContactName)
                @Html.ValidationMessageFor(m => m.ContactName)

            </li>

1 个答案:

答案 0 :(得分:1)

您已声明已更改.live() .on(),建议您使用过时的脚本,因为.live()已在jquery v1.7中折旧并在v1.9中删除。您需要更新与不显眼的客户端验证相关的所有脚本 - jquery {version} .js,jquery.validate.js和jquery.validate.unobtrusive.js到当前版本。

相关问题