how to set Visual Studio 2012 to use JavaScript editor for asp files

 ̄綄美尐妖づ 提交于 2019-12-07 14:57:22

问题


How can I tell Visual Studio 2012 to recognize Classic ASP files (extension .asp) as JavaScript? I have registered .asp extension to Script Editor. That used to do the trick in 2010, but doesn't help here. It seems like VS doesn't know what language to use for Script Editor. There is no keyword highlighting, no intelicense.


回答1:


This can be changed by adding the extension asp with the editor HTML Editor:

Tools -> Options -> Text Editor -> File Extension

  1. For Extension type: asp
  2. Select the HTML Editor
  3. Click Add (or Apply if you are updating an existing rule)

EDIT: Played around a bit and found out that you need to use HTML Editor and not Web Form Editor.

FINAL EDIT: As per comments below, should use the following Script tags around sections of JScript code to indicate to the editor to use JScript intellisense and highlighting:

<script language="JScript" runat="server">
// place your JScript code here
</script>


来源:https://stackoverflow.com/questions/15911230/how-to-set-visual-studio-2012-to-use-javascript-editor-for-asp-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!