-
26 October 2008 09:09
Admin
Visual Studio JavaScript
intellisense feature is very cool. But if you are adding JavaScript
files to Master Pages with ResolveUrl method, you can not use
intellisense feature in design time. Also you can use
intellisense feature with different way. There is a sample code
below.
In Master Page :
<script src="<%=ResolveUrl("~/Js/jquery-1.2.6-intellisense.js")%>"
type="text/javascript"></script>
<asp:Literal ID="ltrJs" runat="server" Visible="false" EnableViewState="false">
<script src="Js/jquery-1.2.6-intellisense.js" type="text/javascript"></script>
</asp:Literal>
First section is require
for detect javascript file's url in runtime. Second section is
require for intellisense support in design time. Second section can
not display in rendered page. Of course you can use
intellisense feature in which pages using this master page.
Updated - 03.11.2008 (Thanks to Visual Web Developer Team) The other way:
<script src="<%=ResolveUrl("~/Js/jquery-1.2.6.js")%>"
type="text/javascript"></script>
<% if (false) { %>
<script src="Js/jquery-1.2.6-intellisense.js" type="text/javascript"></script>
<% } %>