What is an ASAX File?

How to Open, Edit, & Convert ASAX Files

Screenshot of the ASAX file icon

A file with the ASAX file extension is an ASP.NET Server Application file that's used by ASP.NET applications.

The most common ASAX file is the global.asax file that's used for handling certain functions like when the application starts up or shuts down. A web application can only have one of these ASAX files, and it's completely optional to include with the application.

Below the following section is some additional information on ASAX files.

How To Open an ASAX File

Microsoft's Visual Studio software can open ASAX files, as can their free Community edition.

Since ASAX files are just text files that contain code, you can use any text editor to open them. Windows has the Notepad application built-in to the OS that can open the file, but so can third-party programs like the free Notepad++.

Note: ASAX files are not intended to be viewed or opened by the browser. If you've downloaded an ASAX file and expected it to contain information (like a document or other saved data), it's likely that something is wrong with the website, and instead of generating usable information, it provided this server-side file instead.

If this happens, you should be able to rename the file extension from .ASAX to the extension that the file should have been saved with, like .PDF if it's a PDF document.

Important: You can not normally change a file's extension like this and expect the new file to work normally. For that, you'd need a file converter tool. However, in this instance, the problem lies solely in the fact that the file extension was inappropriately named, so renaming it to the right extension will work just fine.

Note: ASX and ASA files are not the same as ASAX files. Even though their file extensions are very similar, an ASX file is a Microsoft ASF Redirector file that stores a playlist of audio or video files, like ASF files. You can open an ASX file with VLC or Windows Media Player. ASA files are ASP Configuration files that a text editor can open.

If you find that an application on your PC does try to open the ASAX file but it's the wrong application or if you would rather have another installed program open ASAX files, see my How To Change the Default Program for a Specific File Extension guide for making that change in Windows.

More Information on the Global.asax File

The global.asax file resides in the root directory of the ASP.NET application and can not be downloaded or viewed by any request except ones that originate on the server side. This means that any external attempt to view or download this particular ASAX file is blocked by default.

You can read more about what the global.asax file is used for over at the Microsoft Developer Network website and at DotNetCurry.com. The ASP.NET website explains how to use the global.asax file and gives a sample file so you can see how the information in the file is structured.

How To Convert an ASAX File

An ASAX file that needs to remain functional as an ASP.NET file should not be converted to any other format. Doing so would mean that the application can't find the file and so can't use it like it needs to.

If you're looking for how to convert global.asax to Code-Behind in order to put the source code in a separate file, see this thread at Coding Forums. However, you should also take a look at this article at ASP Alliance, which describes how ASP.NET v2.0 replaced Code-Behind with Code-Beside.

More Help With ASAX Files

See Get More Help for information about contacting me on social networks or via email, posting on tech support forums, and more. Let me know what kinds of problems you're having with opening or using the ASAX file and I'll see what I can do to help.