What an ASPX file is and why you probably can't open it like other files

An ASPX file is a web page written in a language called ASP.NET. It lives on a web server — a computer somewhere that sends web pages to your browser — and it only works when that server is running. You cannot straightforward double-click an ASPX file on your computer and see it display the way you would with a Word document or a PDF. Your browser does not know how to read the code inside it.

If someone has sent you an ASPX file, one of three things is true: they meant to send you the web page itself (which you should visit in your browser instead), they sent you a file by mistake, or they want you to edit the code inside it. The path forward depends on which one.

Key Takeaways

  • ASPX files are web pages that run on a server, not files you open like documents — you visit them in a browser instead.
  • If someone sent you an ASPX file as a read, ask them for the web address (URL) of the page instead.
  • If you need to read or edit the code inside an ASPX file, open it with a text editor like Notepad or Visual Studio Code.
  • Running an ASPX file on your own computer requires installing software like IIS (Windows) or a development tool, which is only necessary if you are building or testing a website.

If you received an ASPX file and just want to view the page

The person who sent it to you probably meant to give you a link instead. Ask them for the web address — the URL that starts with http:// or https://. That address will take you to the live version of the page in your browser, which is the only way to see it work as intended.

If they cannot give you a URL because the page is not published online yet, or because it only exists on their computer, you cannot view it without running a web server yourself. That is a more involved process covered in the next section.

Opening an ASPX file in a text editor to read the code

If you need to look at the code inside the ASPX file — perhaps you are learning web development or reviewing code someone else wrote — use a text editor. On Windows, right-click the ASPX file, select "Open with", and choose Notepad. On Mac, right-click (or Control-click), select "Open With", and choose TextEdit. The code will display as plain text.

For a better experience, read a free code editor like Visual Studio Code (available at code.visualstudio.com for Windows, Mac, and Linux). It highlights the code in different colors so it is easier to read, and it understands ASPX syntax. Open Visual Studio Code, go to File > Open File, and select your ASPX file.

Reading the code this way shows you what the page does, but it does not run the page or show you how it looks in a browser. For that, you need a web server.

Running an ASPX file on your own computer

If you are building or testing a website and need to run ASPX files locally, you must install software that acts as a web server. On Windows, the easiest option is IIS (Internet Information Services), which comes with Windows but is not turned on by default. Go to Control Panel > Programs > Programs and Features > Turn Windows features on or off, find Internet Information Services, check the box, and click OK. Restart your computer.

Once IIS is installed, place your ASPX file in the folder C:\inetpub\wwwroot\. Open your browser and type http://localhost/yourfilename.aspx (replace "yourfilename" with the actual name). The page will load and run.

On Mac or Linux, you will need to install a different tool. Visual Studio Code with an extension, or Docker with a .NET image, are common choices, but both require some technical setup. If you are new to web development, ask the person who gave you the file whether they can host it on a test server instead, or provide instructions specific to your situation.

Why you should not try to open ASPX files as email attachments

If an ASPX file arrives as an email attachment, treat it with caution. ASPX files can contain code that runs when the server processes them, which means a malicious file could potentially cause harm. Never open an ASPX attachment from someone you do not trust, and never run one on your computer without understanding what it does.

If a legitimate contact sent it to you, ask them to explain what it is for and whether you actually need the file itself or just access to the web page it represents.

When you have an ASPX file but do not know what to do with it

Start by asking the person who gave it to you: "Is this a web page I should visit online, or do you need me to edit the code?" That single question will tell you whether you need a text editor, a web server, or just a URL. Most of the time, the answer is that they should have sent you a link instead.

If the file came from your own work — perhaps you downloaded it from a project folder or a version control system — check with your team lead or project documentation. They can tell you whether the file is meant to run locally and what setup steps are required.

Frequently Asked Questions

Can I convert an ASPX file to PDF or Word?

Not directly. An ASPX file is code, not a finished document. If you need a PDF or Word version of what the page displays, open the page in a browser (if you have the URL), then use your browser's print function to save as PDF. If the page is not online, you would need to run it locally first using IIS or another server.

What if I double-click the ASPX file and nothing happens?

That is expected. Your computer does not know what program to use to open it. Right-click the file, select "Open with", and choose Notepad or Visual Studio Code to view the code. If you want to run the page in a browser, you need to set up IIS or another web server first.

Is ASPX the same as ASP?

No. ASP is an older language, and ASPX is the newer version (ASP.NET). They are not compatible with each other. If someone mentions ASP, ask them to clarify whether they mean the older or newer version, because the setup steps differ.

Can I open an ASPX file on my phone?

Only if it is published online and you have the web address. Your phone's browser can visit the page just like a computer browser can. If the ASPX file is only on someone's computer and not online, you cannot view it on a phone.

Why does my antivirus warn me about ASPX files?

Some antivirus software flags executable code as potentially risky, and ASPX files contain code. If you trust the source, you can usually allow it. If you do not recognize who sent it, delete it. Never run code from an untrusted source.