2014-04-06 125 views
0

我的客户端验证不更新工作客户端验证工作不

我的剧本是在正确的顺序...(我写了他们按照教程)
我的浏览器(Chrome)启用javascript

web.config文件

<add key="ClientValidationEnabled" value="true" /> 
<add key="UnobtrusiveJavaScriptEnabled" value="true" /> 

编辑观点:

@model MultipleRowsDemo.Models.Employee 

@{ 
    ViewBag.Title = "Edit"; 
} 
<script src="~/Scripts/jquery-1.7.1.min.js" type="text/javascript"></script> 
<script src="~/Scripts/jquery.validate.min.js" type="text/javascript"></script> 
<script src="~/Scripts/jquery.validate.unobtrusive.min.js" type="text/javascript"></script> 
<h2>Edit</h2> 

@using (Html.BeginForm()) { 
    @Html.ValidationSummary(true) 

    <fieldset> 
     <legend>Employee</legend> 

     @Html.HiddenFor(model => model.Id) 

     <div class="editor-label"> 
      @Html.LabelFor(model => model.FUllName) 
     </div> 
     <div class="editor-field"> 
      @Html.EditorFor(model => model.FUllName) 
      @Html.ValidationMessageFor(model => model.FUllName) 
     </div> 

     <div class="editor-label"> 
      @Html.LabelFor(model => model.Gender) 
     </div> 
     <div class="editor-field"> 
      @Html.EditorFor(model => model.Gender) 
      @Html.ValidationMessageFor(model => model.Gender) 
     </div> 

     <div class="editor-label"> 
      @Html.LabelFor(model => model.AGE) 
     </div> 
     <div class="editor-field"> 
      @Html.EditorFor(model => model.AGE) 
      @Html.ValidationMessageFor(model => model.AGE) 
     </div> 

     <div class="editor-label"> 
      @Html.LabelFor(model => model.HireDate) 
     </div> 
     <div class="editor-field"> 
      @Html.EditorFor(model => model.HireDate) 
      @Html.ValidationMessageFor(model => model.HireDate) 
     </div> 

     <div class="editor-label"> 
      @Html.LabelFor(model => model.EmailAddress) 
     </div> 
     <div class="editor-field"> 
      @Html.EditorFor(model => model.EmailAddress) 
      @Html.ValidationMessageFor(model => model.EmailAddress) 
     </div> 

     <div class="editor-label"> 
      @Html.LabelFor(model => model.Salary) 
     </div> 
     <div class="editor-field"> 
      @Html.EditorFor(model => model.Salary) 
      @Html.ValidationMessageFor(model => model.Salary) 
     </div> 

     <div class="editor-label"> 
      @Html.LabelFor(model => model.PersonalWebSite) 
     </div> 
     <div class="editor-field"> 
      @Html.EditorFor(model => model.PersonalWebSite) 
      @Html.ValidationMessageFor(model => model.PersonalWebSite) 
     </div> 

     <div class="editor-label"> 
      @Html.LabelFor(model => model.Photo) 
     </div> 
     <div class="editor-field"> 
      @Html.EditorFor(model => model.Photo) 
      @Html.ValidationMessageFor(model => model.Photo) 
     </div> 

     <div class="editor-label"> 
      @Html.LabelFor(model => model.AlternateText) 
     </div> 
     <div class="editor-field"> 
      @Html.EditorFor(model => model.AlternateText) 
      @Html.ValidationMessageFor(model => model.AlternateText) 
     </div> 

     <p> 
      <input type="submit" value="Save" /> 
     </p> 
    </fieldset> 
} 

<div> 
    @Html.ActionLink("Back to List", "Index") 
</div> 

类似的帖子:

asp.net mvc client side validation not working?

MVC 4 Client side validation not working

这篇文章建议脚本应该以正确的顺序

jquery client side validation not working in MVC3 partial view MVC3偏视

这个问题是关于局部视图...我没有一个

请建议

+0

验证火灾? –

回答

-1

如果你有_layout或母版页可以保持脚本的链接出现。

+0

我没有..... – user3487944