ResolveUrl and JavaScript Intellisense in Visual Studio

 - 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>
<% } %>


Paylaş

Tags: , , ,

ASP.NET | JavaScript | Tips & Tricks

Add comment




  Country flag
biuquote
  • Comment
  • Preview
Loading


About the author

Mustafa OZCAN Mustafa ÖZCAN
Software Developer

E-mail me Send mail

PayPal Donate


Recent comments

Comment RSS

Calendar

<<  February 2012  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011

View posts in large calendar

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in  anyway.

© Copyright 2008

Added Files

File Hit
jquery-1.2.6-intellisense.js 5171
   

Online : 6