部分视图中的客户端验证问题 [英] Client side validation issue in partial view

查看:81
本文介绍了部分视图中的客户端验证问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在部分视图中使用MVC 5中的模型库clientSide验证,然后添加



I try to use model base clientSide validation in MVC 5 on my partial view and i add

<script src="~/Scripts/jquery.validate.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>





在我的布局页面上引用但是无法工作。

但是当我在该局部视图上添加引用时它运行良好。

如何使用布局页面引用。



references on my layout page but that is not able to work.
but when i add the references on that partial view its working well.
how it is possible to use layout page references.

推荐答案

你应该可以将它们添加到布局中,只需确保它们出现在引用jquery之后。如果它仍然不起作用,您需要在上下文中发布脚本引用。
You should be able to add them to the layout, just make sure they appear after the reference to jquery. If it's still not working you'll need to post the script references in context.


这篇关于部分视图中的客户端验证问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆