@Scripts 不存在于 Asp.Net MVC 中 [英] @Scripts doesn't exist in Asp.Net MVC
本文介绍了@Scripts 不存在于 Asp.Net MVC 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在 Asp.Net MVC 中添加模型验证,
所以我首先需要在 Views\Share_Layout.cshtml 中导入库.
I'm trying to add Model validation in Asp.Net MVC ,
So I need to import the libraries at first inside Views\Share_Layout.cshtml .
然后它在一秒钟内杀死我.
Then it kills me in a second.
@Scripts 不存在
这是怎么回事?如果需要更多信息,请告诉我.谢谢:)
What is going on ? If some further information needed , please tell me. Thanks :)
推荐答案
- 安装
Microsoft.AspNet.Web.Optimization
- 在
web.config
(Views 文件夹)中,确保您在命名空间<add namespace="System.Web.Optimization"/>
下
- Install
Microsoft.AspNet.Web.Optimization
- In
web.config
(Views folder) make sure you have under namespaces<add namespace="System.Web.Optimization"/>
这篇关于@Scripts 不存在于 Asp.Net MVC 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文