3

I'm working with a codebase for a large number of websites which contains files with a custom extension that are essentially *.aspx files. Size and complexity of the project, among other things, prevent me from simply renaming them to *.aspx permanently.

Setting Options->Text Editor->File Extension to use HTML (Web Forms) Editor, or to other providers in the list, for the custom file extension, and reopening the file can improve some things at the cost of others, but does not give the same results as renaming the file to *.aspx.

If I rename the file to *.aspx and re-open it, I instantly get syntax highlighting, intellisense, type-checking etc as expected.

How can I get this to work with my custom file extension?

Is there a way to force the file extension parameter into the HTML (Web Forms) Editor parser?

Is what I want even possible without writing a custom extension for VS?


Example of typical file layout:

    <%@ Page Language="C#" AutoEventWireup="True" %>

    <%@ Import Namespace="System.Collections.Generic" %>
    <%@ Import Namespace="System.Data" %>

    <!--other imports-->


    <script runat="server">

    //c# code

    </script>

    <!-- js code and/or html with <%=mOutput%> blocks -->    

Non-exhaustive list of superficially related SO questions I read that didn't resolve this issue:

TheAtomicOption
  • 1,456
  • 1
  • 12
  • 21
  • I'm getting this issue on files that are already aspx pages. Everything between the – Inphinite Phractals Feb 29 '20 at 01:22

0 Answers0