[已解决]使用ScriptManager的jQuery Intellisense无法正常工作 [英] [Solved] jQuery Intellisense using ScriptManager Not Working

查看:65
本文介绍了[已解决]使用ScriptManager的jQuery Intellisense无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

-Visual Studio 2010专业版

我希望有人能对此有所了解,因为我在这里把头发扯了,而且我没有那么多了.

当我使用常规脚本标签添加jQuery库时,intellisense可以正常工作:

- Visual Studio 2010 Professional

I hope someone can shed some light on this because I''m tearing my hair out here and I don''t have that much left.

When I add the jQuery library using a regular script tag, intellisense works just fine:

<script src="~/Scripts/jquery-1.4.1.js" type="text/javascript"></script>


如果我使用ScriptManager控件,则intellisense停止工作:


If I use a ScriptManager control, intellisense stops working:

<asp:ScriptManager runat="server" EnablePageMethods="true">
    <Scripts>
        <asp:ScriptReference Path="~/Scripts/jquery-1.4.1.js" />
    </Scripts>
</asp:ScriptManager>


该页面仍按预期显示,我在设计时还没有智能感知.

在Visual Studio 2010的beta版本中,这似乎已经成为一个问题,但是从所有方面来看,它已在最终版本中得到修复.

谢谢您的宝贵时间.
亚当


The page still displays as expected I just have no intellisense at design time.

This seems to have been an issue in beta versions of Visual Studio 2010 but by all accounts it has been fixed in the final release.

Thanks for your time.
Adam

推荐答案

我已经找到了解决我问题的方法,所以为了完整起见就在这里发布.

我在主页上添加了以下语句:
I have found a solution to my problem, so just posting here for completeness.

I added the following statement to my master page:
<% if (false) { %>
    <script src="~/Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
<% } %>


我现在在Visual Studio 2010中具有jQuery的智能感知功能.

亚当


I now have intellisense for jQuery in Visual Studio 2010.

Adam


好吧,对我来说,您的实际问题是,使用脚本管理器引用时,未启用脚本etellisense,并且仍然有效!

为此,我认为可能的原因之一可能是文件的相对URL.可能与您在其他地方使用的不一样.
Well, to me, your actual problem was that the scrip intellisense was not getting enabled when referenced using Script manager and that still stands!

To that, I think one of the possible reasons can be the relative URL of the file. It might not be the same as you are using at other place.


这篇关于[已解决]使用ScriptManager的jQuery Intellisense无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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