What is an ASCX File?

How to Open, Edit, & Convert ASCX Files

ASCX Icon

A file with the ASCX file extension is an ASP.NET Web User Control file.

Basically, ASCX files make it easy to use the same code across multiple ASP.NET web pages, saving time and energy when building a website.

For example, a number of ASPX files on a website might link to a single ASCX file that contains code for a website's navigation menu. Instead of writing the same code on every page of the website that needs the menu, each page can just point to the ASCX file, making managing and updating the menu on every page much easier.

Considering how effective ASCX files are at simplifying ASP.NET programming, these files are often used for other consistent parts of a website, like headers, footers, etc.

How To Open an ASCX File

Microsoft's Visual Web Developer and Visual Studio can open and edit ASCX files, as well as Adobe's Dreamweaver.

Though an ASCX file is linked to from inside an ASPX file (which can be viewed in a browser), the ASCX file itself is not intended to be opened by the browser. If you've downloaded an ASCX 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 the usable information you were after, it provided this server-side file instead.

If that happens, try downloading the file again or even just renaming the file to the extension you expected it to be. Sometimes that works.

How To Convert an ASCX File

A file converter is usually the recommended tool for converting most types of files, like videos, music file, images, documents, etc.

However, converting a file like an ASCX file to something else will break its functionality, so it probably isn't something you want to do, especially if the ASCX file is being hosted online and is otherwise working.

For example, changing a working file with the .ASCX file extension to anything else means that all of the ASPX files that are pointing to that ASCX file will cease to understand what the file is for.

However, the opposite conversion might actually be something you're interested in: converting an ASPX page to an ASP.NET Web User Control file with the ASCX extension. A number of manual changes are required to make this happen, so be sure to follow Microsoft's instructions very carefully.

Microsoft has another tutorial on turning an ASCX file into a Redistributable Custom Control (a DLL file). If you know anything about DLL files, you may have already realized that ASCX files behave very much like the shared DLL files on your Windows computer.

More Information on ASCX Files

ASCX files and ASPX files are made up of very similar code, but Web User Control files don't contain any html, body,or form elements.

Microsoft's How to: Create ASP.NET User Controls explains the steps it takes to create an ASCX file, and Bean Software has some good examples on how to add Web User Control files to an ASP.NET page.