📖 What is an ASP File?
An ASP file is a web page that runs on a server. The letters stand for Active Server Pages, an early Microsoft technology for building websites, and a file with the .asp extension holds a mix of ordinary web page content and script that the server runs before anyone sees the page.
Picture a normal web page that can think for itself. A plain HTML page always shows the same thing, but an ASP page can run a little program each time it is requested, so it can greet you by name, pull the latest prices from a database or show today's date. The clever part happens on the server, out of sight, and only the finished page reaches your browser.
The single most important thing to grasp is that an ASP file is meant for a server, not for your own machine. That one fact explains why opening it by double-clicking rarely does what people expect, and it is worth understanding before anything else.
Key Characteristics
- A server-side web page from Microsoft
- Mixes HTML with script in one file
- Usually written in VBScript
- Runs on a web server, not the browser
Good to Know
- Plain text inside, so any editor opens it
- Needs a server to actually run
- Classic ASP, the original, uses .asp
- ASP.NET, the successor, uses .aspx
⚡ Quick Facts
| File Extension | .asp |
| Full Name | Active Server Pages |
| Developer | Microsoft |
| First Released | 1996 |
| Runs On | Internet Information Services (IIS) |
| Default Language | VBScript |
| Successor | ASP.NET, using .aspx |
| File Type | Plain text |
🖥️ Why It Runs on the Server
The heart of an ASP file is that its code runs on the web server, never in the visitor's browser. This is what people mean by a server-side page, and it shapes everything about how the format behaves.
When a browser asks for an .asp page, the web server steps in first. It reads the file, runs the script inside it, builds a finished web page from the result and sends only that plain page back. The visitor receives ordinary HTML and never sees the original code, which stays safely on the server. This is why the technology is named Active Server Pages, and why an .asp file cannot do its job without a server to run it. Open the same file straight from your desktop and the script has nowhere to run, so you see either the raw code or a page that does nothing.
🗂️ What an ASP File Holds
An ASP file is a plain text document, and inside it three kinds of content sit side by side. Together they let one file describe both how a page looks and what it does.
HTML Markup
The ordinary page structure and text, the same tags you would find in any web page.
Server-Side Script
The code, usually VBScript, that the server runs to work things out before sending the page.
Plain Text and CSS
Static wording and styling that never changes, mixed in among the parts that do.
The script is marked off from the rest with special tags so the server knows which parts to run and which parts to pass along as they are. Everything outside those tags is treated as ordinary page content, which is why an ASP file can read almost like a normal web page with small pockets of code tucked inside.
🔬 Inside the Code
A short example shows how the pieces fit together. In an ASP file the script lives between the special markers, and everything else is plain web page content.
A tiny ASP page that shows the date
<html> <body> The time right now is <% Response.Write(Now) %> </body> </html> ' the server runs the part between <% and %>, ' then sends plain HTML with the date filled in
The markers that open and close with a percent sign tell the server where the script begins and ends. Here the Response.Write command prints the current time into the page, so each visitor sees the moment they loaded it. The server handles that line, drops the result into the page and sends the finished HTML onward. The built-in helpers an ASP page can call, with names like Request, Response, Server and Session, are how the script reads incoming requests and writes out the reply.
🧩 Applications, global.asa and Includes
A single .asp page rarely stands alone. Classic ASP groups pages into an application, and two features hold that application together, a special startup file and a way to share code between pages.
At the root of an ASP application sits an optional file named global.asa. It is not a page you visit but a place to put code that runs at set moments, such as when the application first starts or when a new visitor begins a session. Each application has just one global.asa, kept in its top folder, and it commonly sets up shared values or opens a database connection that every page can then use. Alongside it, ASP pages share common code through server-side includes, a line that pulls another file, often with an .inc or .asp name, into the page before it runs.
A server-side include and a global.asa handler
<!-- pull a shared file into this page --> <!-- #include file="header.inc" --> ' inside global.asa, run once when the app starts <script language="vbscript" runat="server"> Sub Application_OnStart ' set up shared values here End Sub </script>
To reach a database, an ASP page turns to a helper called ADO, creating an ADODB.Connection and opening a link to a data source such as a Microsoft Access file or a SQL Server database. This is how Classic ASP pulls live information into a page, and putting that connection setup in global.asa is a common way to share it across a whole application. A frequent stumbling block is the include file not found error, which simply means the path in an include line does not point at a real file.
⚖️ ASP vs ASPX
One of the most common questions is how an .asp file differs from a .aspx file, and the short answer is that they belong to two generations of the same Microsoft family.
An .asp file is Classic ASP, the original technology from the 1990s, and its script is usually VBScript that the server reads and runs line by line. A .aspx file belongs to ASP.NET, the successor Microsoft released in 2002, and it is normally written in a compiled language such as C#. The practical upshot is that .aspx pages are compiled into a faster form and come with a much larger toolkit, while .asp pages are simpler and interpreted as they run. If you meet an .asp file today it is almost certainly part of an older website, whereas .aspx points to the newer framework.
| Trait | .asp (Classic ASP) | .aspx (ASP.NET) |
|---|---|---|
| Released | 1996 | 2002 |
| Usual language | VBScript | C# or VB.NET |
| How it runs | Interpreted line by line | Compiled first |
| Toolkit | Small and simple | Large framework |
| Seen on | Older sites | Newer sites |
📂 How to Open an ASP File
What you do with an ASP file comes down to a simple choice, reading its code or actually running it. To look at what is inside, any text editor will do, because the file is plain text.
A text editor
Open the file in Notepad or a code editor to read and edit the source, since it is plain text.
A code editor or IDE
An editor like Visual Studio Code adds colour and structure that make the script easier to follow.
A web browser, with a server
To see the page it produces, request it through a server rather than opening the file directly.
For reading or changing the code, a plain editor or a code editor is all you need, and a code editor is the friendlier choice because it colours the different parts and helps spot mistakes. What you should not expect is to double-click an .asp file and see a working web page. Without a server to run the script, your browser will show the raw code or an empty page, which brings us to how the file is actually run.
▶️ Running an ASP File
To see the page an ASP file produces, rather than just its code, you need a web server that understands Classic ASP. On Windows that means Internet Information Services, Microsoft's own web server.
The catch is that modern versions of IIS do not switch on Classic ASP by default, because it is an older technology. You turn it on through the Windows features settings, adding the ASP component to IIS, and then place your .asp file in a folder the server publishes. Once that is set up, you request the page through a web address rather than by opening the file, and the server runs the script and returns the finished page. For simply viewing an old .asp file you were sent, setting up a whole server is usually more than you need, and reading the source in an editor is the quicker path.
⚙️ Enabling Classic ASP in IIS
Because modern Windows leaves Classic ASP switched off, running an .asp page means turning the feature on first. On a desktop version of Windows the quickest route is through the Windows features list.
Open Windows features
Run appwiz.cpl, or open Control Panel, then choose turn Windows features on or off.
Find IIS
Expand Internet Information Services, then World Wide Web Services, then Application Development Features.
Tick ASP
Select the ASP box. Windows adds the ISAPI Extensions it depends on for you.
Add your site
In IIS Manager, add a site pointing at your folder, then request a page by its web address.
On Windows Server the same feature lives under the Web Server role, added through Server Manager rather than the features list, but the component you are after is still ASP under Application Development. Once it is on, IIS runs the script in any .asp file you serve. A useful tip while setting things up is to switch the server to send detailed errors to the browser, since the default response on a fresh install is only a note that ASP is not installed, which hides the real message.
🏛️ A Short History
Active Server Pages arrived in 1996 as Microsoft's first way of building dynamic websites, shipping with the Windows NT server software of the day as part of Internet Information Services.
In the early web it was a major tool, letting sites move past fixed HTML pages into content that could change for each visitor. In 2002 Microsoft released ASP.NET as its successor, a far larger framework built on the .NET platform, and the original technology picked up the name Classic ASP to tell the two apart. Classic ASP was never really removed, and IIS can still run it, which is why plenty of long-standing business websites continue to serve .asp pages to this day even as new projects use newer tools.
🔄 Editing and Moving On
People sometimes look for a way to convert an .asp file, but because it is source code rather than a document, there is no simple conversion to another format. What you do instead depends on your goal.
To change how a page works, you edit the .asp source directly in an editor and save it back. To retire an old site built on Classic ASP, the real task is not converting files but rewriting the application on a newer framework such as ASP.NET or another modern web platform, which is a development project rather than a file conversion. If all you want is a plain record of what a page produced, you can request the page from a server and save the resulting HTML, though that captures the output and not the working script behind it.
🛠️ Common Issues
Most confusion around ASP files traces back to the same root, that the file is built for a server. Each common problem has a clear explanation.
| Browser shows the raw code | The file was opened directly with no server to run it. Serve it through IIS to see the finished page. |
| Page downloads instead of running | The server is not set up to process ASP. Add the Classic ASP component to IIS. |
| Blank page in the browser | Often a script error on the server. Turn on detailed errors in IIS to see what went wrong. |
| Confused with .aspx | An .asp file is Classic ASP, while .aspx is the newer ASP.NET. They are not interchangeable. |
❓ Frequently Asked Questions
An ASP file is a web page that runs on a server, built with Classic Active Server Pages, an early Microsoft technology. A file with the .asp extension holds a mix of ordinary HTML and server-side script, usually written in VBScript. When someone requests the page, the web server runs the script, builds a finished web page and sends only that back to the browser. The visitor never sees the original code. It is how older Microsoft websites created pages that could change for each visitor rather than staying fixed like plain HTML.
To read or edit an ASP file, open it in any text editor, since it is plain text, though an editor built for code, like Visual Studio Code, is nicer because it tints the script and the HTML. To actually see the web page it produces, you need a web server that runs Classic ASP, because the code has to run on a server rather than in your browser. If you only want to inspect what a file contains, the text editor route is quick and needs nothing else installed.
That happens because there is no server running the ASP script. An ASP file is meant to be processed by a web server, which runs the code and sends back a finished page. When you open the file directly from your computer, or request it from a server that is not set up for ASP, nothing runs the script, so you see the raw code or the file downloads. To see the working page, it has to be served by a web server with Classic ASP enabled.
An .asp file is Classic ASP, the original Microsoft technology from 1996, and its script is usually VBScript that the server runs line by line. A .aspx file belongs to ASP.NET, the successor released in 2002, and it is normally written in a compiled language like C#. So .aspx pages are compiled and come with a much larger framework, while .asp pages are simpler and interpreted as they run. In short, .asp is the older generation and .aspx is the newer one, from the same Microsoft family.
Classic ASP files are usually written in VBScript, which is the default scripting language for the technology. They can also use JScript, Microsoft's version of JavaScript, though that is less common. The script sits between special markers inside the file, mixed in with ordinary HTML, and the server runs it to build the page. This is different from ASP.NET, the newer .aspx format, which normally uses a compiled language such as C# instead of VBScript.
Yes. An ASP file is server-side, which means its code only runs when a web server processes it. On Windows that server is Internet Information Services, or IIS, and modern versions do not switch on Classic ASP by default, so you add it through the Windows features settings. Once ASP is enabled and the file sits in a folder the server publishes, you request the page through a web address and the server runs it. Without a server, the script has nowhere to run and the page will not work.
Yes, though it is old. Microsoft released ASP.NET as its successor back in 2002, and new websites are built with newer tools, but Classic ASP was never fully removed and IIS can still run it. As a result many long-standing business websites continue to serve .asp pages years later, because rewriting a working site is a large job. So while you would not choose Classic ASP for a new project, plenty of existing sites still rely on it, which is why the file type is still around.
On a desktop version of Windows, open turn Windows features on or off, expand Internet Information Services, then World Wide Web Services, then Application Development Features, and tick the ASP box. Windows adds the ISAPI Extensions it depends on automatically. On Windows Server you add the same ASP component under the Web Server role through Server Manager instead. Once it is on, add a site in IIS Manager pointing at your folder and request a page by its web address. It also helps to set the server to send detailed errors to the browser while you test.
The global.asa file is an optional file that sits in the root folder of a Classic ASP application and holds code that runs at set moments rather than on a page you visit. Its handlers fire when the application first starts or when a new visitor begins a session, which makes it a natural place to set up shared values or open a database connection every page can use. Each application has only one global.asa, kept in its top directory. It is not requested directly in the browser, but the server runs it behind the scenes.
Both are server-side scripting technologies that build web pages, but they come from different worlds. Classic ASP is Microsoft's, normally written in VBScript and run by the IIS web server on Windows. PHP is open source, has its own language, and most often runs on the Apache web server, frequently on Linux. In practice they solve the same problem in different ecosystems, and both can even run on the same IIS server if needed. ASP files use the .asp extension while PHP files use .php, and a given website is usually built around one or the other.
Classic ASP reaches a database through a helper called ADO, short for ActiveX Data Objects. The script creates an ADODB.Connection, opens a link to a data source such as a Microsoft Access file or a SQL Server database, runs a query and reads the results back into the page. Because this setup can be shared, a common pattern is to open the connection in the global.asa file so every page in the application can use it. This is how a Classic ASP page shows live data, like a product list or a user's details, rather than fixed text.
An include is a way for one ASP page to pull in another file before it runs, so shared pieces like a header, footer or set of helper functions live in a single place. The include line names the file, often one with an .inc or .asp extension, and the server drops its contents into the page. It saves repeating the same code across many pages. A common error, include file not found, means the path in the include line does not point at a real file, so checking that path usually fixes it.
Enabling ASP does not by itself weaken a server, but Classic ASP is old technology, so security depends heavily on how the code is written and kept up to date. Because the script runs on the server and never reaches the visitor, keeping logic and any credentials in the ASP file rather than the page is a genuine strength. The risks come from careless code, such as building database queries from unchecked user input, which can open the door to attacks. A Classic ASP site handling sensitive data needs the same careful review and maintenance any web application does.
📝 Summary
An ASP file is a Classic Active Server Pages document, an early Microsoft technology from 1996 for building web pages that run on a server. A file with the .asp extension is plain text that mixes ordinary HTML with server-side script, usually VBScript, marked off between percent-sign tags. Its defining trait is that the code runs on the web server, Internet Information Services on Windows, which executes the script, builds a finished page and sends only plain HTML to the browser, so the visitor never sees the original code. That is why an ASP file needs a server to work and why opening it directly shows the raw source or a page that does nothing. You read and edit the file in any text editor because it is plain text, but to see the page it produces you serve it through IIS with the Classic ASP component switched on, since modern IIS leaves it off by default. The format is often confused with .aspx, which belongs to the newer ASP.NET released in 2002 and normally uses a compiled language such as C#, whereas Classic ASP is simpler and interpreted as it runs. There is no real file conversion for an ASP file since it is source code, so you edit it directly, and moving a site off Classic ASP means rebuilding it on a newer framework rather than converting files. Though old, Classic ASP is still served by many long-standing websites today.