如何在VS 2010中将Jquery VS intellisense引用添加到我的视图中 [英] How do I add Jquery VS intellisense reference to my view in VS 2010

查看:70
本文介绍了如何在VS 2010中将Jquery VS intellisense引用添加到我的视图中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试让Jquery intellisense在Visual Studio 2010中工作.

I am trying to get Jquery intellisense working in Visual Studio 2010.

我已经查看了StackOverflow,并尝试将其添加到我的视图中:

I've looked around on StackOverflow and tried adding this to my view:

@{
     /// <reference path="/Scripts/jquery-1.5.1-vsdoc.js"/>
 }

那是行不通的.通过在每个视图中添加相同的脚本标记,可以使它正常工作,但这并不理想,因为我想将所有脚本都放在布局页面底部的一个位置.

That's not working.. I've got it working by adding the same script tag to each view but this is less than ideal since i want to keep all my scripts in one place at the bottom of my layout page.

推荐答案

@if (false) { ... }块内的每个视图中添加<script>标记.

Add the <script> tags to each view inside an @if (false) { ... } block.

IDE仍会看到它们,并提供IntelliSense,但它们在运行时不会执行任何操作.

The IDE will still see them, and provide IntelliSense, but they won't do anything at runtime.

这篇关于如何在VS 2010中将Jquery VS intellisense引用添加到我的视图中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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