Is this the “right” solution for getting ASP.NET MVC and javascript intellisense to play well?

Due to the way the paths relate to VS, resolving the path to the JS file, and then how the actual path at runtime is resolved through the browser, I currently have the following location at the top of my main page in my application. that all my views have corresponding JS intellisense and are correctly resolved to execute:

<% if (false) { %>
    <script src="../../Scripts/jquery-1.3.2.js" type="text/javascript"></script>
    <script src="../../Scripts/MicrosoftAjax.js" type="text/javascript"></script>
    <script src="../../Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script>
<% } else { %>
    <script src="<%= ResolveUrl("~/Scripts/jquery-1.3.2.js")%>" type="text/javascript"></script>
    <script src="<%= ResolveUrl("~/Scripts/MicrosoftAjax.debug.js") %>" type="text/javascript"></script>
    <script src="<%= ResolveUrl("~/Scripts/MicrosoftMvcAjax.debug.js") %>" type="text/javascript"></script>
<% } %>

Is this possible, as others do, or is there some crazy better way to make me look like an ass? Thanks!

+3
source share
2 answers

, ( VS 2010!).

+2

, , . , , . .

script, .js , script . , (ascx) , . , Intellisense.

0

Source: https://habr.com/ru/post/1714543/


All Articles