The best way to use intellisense in your favorite editor, like Visual Studio Code or anything else, is to name these files with the .js extension.
But, there’s a security issue. If you name these files like that, they should be returned to your client in plain text if called from a web browser. You don’t want your server-side code to be exposed through IIS.
What you need to do, is just put all these files in a specific folder, in which you will disable all IIS handlers, by using the following steps.
- In your application root, create a folder called
- In that folder, create a web.config file, and add this content:
<system.webServer> <handlers> <clear /> </handlers> </system.webServer>
You can now add all your server-side JS in that folder, and they will private to your ASP code.
If you call that js file in the browser, you will get a 404:
From your ASP page in the root, include them like this:
That’s all! Happy Coding.