admin管理员组文章数量:1392094
I downloaded MVC Fool Proof Validation from /
Beacuse I am in need of [RequiredIf].
When I installed MVC Fool Proof Validation I recieved three Javascript files
which are these that I am using inside my layout:
<script src="@Url.Content("~/Scripts/mvcfoolproof.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/MvcFoolproofJQueryValidation.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/MvcFoolproofValidation.min.js")" type="text/javascript"></script>
Problem is that when I check my scripts with Chrome I get the following errors on these these JS files.
Uncaught TypeError: Cannot read property 'adapters' of undefined mvcfoolproof.unobtrusive.min.js:54
Uncaught TypeError: Cannot read property 'ValidatorRegistry' of undefined MvcFoolproofValidation.min.js:50
This is the error on the first one
Second error:
I have not even edited anything inside the JS files :S Any solutions is appreciated!
Thanks in advance!
I downloaded MVC Fool Proof Validation from http://foolproof.codeplex./
Beacuse I am in need of [RequiredIf].
When I installed MVC Fool Proof Validation I recieved three Javascript files
which are these that I am using inside my layout:
<script src="@Url.Content("~/Scripts/mvcfoolproof.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/MvcFoolproofJQueryValidation.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/MvcFoolproofValidation.min.js")" type="text/javascript"></script>
Problem is that when I check my scripts with Chrome I get the following errors on these these JS files.
Uncaught TypeError: Cannot read property 'adapters' of undefined mvcfoolproof.unobtrusive.min.js:54
Uncaught TypeError: Cannot read property 'ValidatorRegistry' of undefined MvcFoolproofValidation.min.js:50
This is the error on the first one
Second error:
I have not even edited anything inside the JS files :S Any solutions is appreciated!
Thanks in advance!
Share Improve this question edited Apr 3, 2012 at 8:59 Obsivus asked Apr 3, 2012 at 8:37 ObsivusObsivus 8,35913 gold badges56 silver badges98 bronze badges3 Answers
Reset to default 3Looks like you included the scripts before you include jQuery. You should include jQuery before these scripts
Be careful using FoolProof RequiredIf in MVC4.
This works: [RequiredIfTrue("lead_remendation", ErrorMessage="required")]
This does not: [RequiredIfTrue("lead_remendation", ErrorMessage="Required")]
I spent hours racking my brain on this.
Do the below steps:
- Step 1:
PM> Install-Package MicrosoftAjax
- Step 2:
PM> Install-Package MicrosoftMvcAjax.Mvc5
- Step 3:
Include them in bundleconfig like below:
bundles.Add(new ScriptBundle("~/bundles/mvcFoolProof").Include(
"~/Scripts/MicrosoftAjax*",
"~/Scripts/MicrosoftMvcAjax*",
"~/Scripts/MicrosoftMvcValidation*",
"~/Scripts/mvcfoolproof*",
"~/Scripts/MvcFoolproofJQueryValidation*",
"~/Scripts/MvcFoolproofValidation*"));
Now it should work without any errors.
本文标签: javascriptMVC fool proof validation error inside the JS filesStack Overflow
版权声明:本文标题:javascript - MVC fool proof validation error inside the JS files - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744780417a2624675.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论