0

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"?

ʞᴉɯ
  • 5,376
  • 7
  • 52
  • 89
  • I didn't catch, you mean a normal js file but with aspx extension, no header, no script tag? – Alain BUFERNE Nov 05 '12 at 13:29
  • yes; my js file look like <%@ Page Title="" Language="C#" %> <% Response.ContentType = "application/x-javascript"; %> .... js code .... – ʞᴉɯ Nov 05 '12 at 17:22
  • Did you have a look to this thread : http://stackoverflow.com/questions/11782845/treat-external-javascript-file-as-part-of-aspx-page ? – Alain BUFERNE Nov 06 '12 at 09:30

1 Answers1

0

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