in a web application i've some dynamic js files, with aspx extension; i would to benefit the syntax highlighting / intellisense support for javascript while editing, but Visual Studio does not recognize the file as javascript. Is there some way to force visual studio to threat a file with a custom "editing experience"?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I am using a similar approach to what you are doing. I'm using Visual Studio 2013 and I can fool it by adding a <script> tag in a code block that is not executed:
<%@ page language="C#" autoeventwireup="false" codefile="Script.aspx.cs" EnableViewState="false" inherits="Script" StyleSheetTheme="" %>
<% if (false){ %> <script type="text/javascript"> <% }%>
... Javascript goes here
<% if(false){ %> </script> <% }%>