What is the ASPX file format?
.aspx is an extended version of the Active Server Page format, developed by Microsoft as part of the ASP.NET Web Forms framework - a server-side technology built on the .NET platform. The main purpose of this framework is to develop dynamic websites, web-based services and applications.
The working of an .aspx file is similar to that of .asp, but in .aspx static HTML markup is combined with ASP.NET server controls and a code-behind file written in C# or VB.NET. A page named Default.aspx, for example, typically pairs with Default.aspx.cs or Default.aspx.vb. At runtime the server processes the .aspx source and delivers plain HTML to the browser - any browser can be used to view the output.
Related ASP.NET file types include .ascx (user controls) and .ashx (HTTP handlers). Modern ASP.NET development has largely moved to .cshtml Razor pages, but .aspx Web Forms remain common in legacy enterprise applications.
Security & safety
RISK: LOWThe .aspx extension itself says nothing about safety - when it appears in a URL it is just a normal web page; treat the site as you would any website (watch for phishing on banking/login pages). A downloaded .aspx file is typically harmless HTML or a misnamed document, and opening it in a text editor is always safe. Caution only applies if a download you didn't expect arrives as .aspx from an untrusted source - inspect it as text before renaming and opening, and never run anything it tries to launch.
Format details
in a nutshellPrograms that open ASPX files
Technical details
deep spec| Developer | Microsoft |
| MIME type | text/html |
| Source file format | UTF-8 plain text; no binary signature; typically begins with a <%@ Page %> directive |
| Code-behind pairing | Each .aspx file pairs with .aspx.cs (C#) or .aspx.vb (VB.NET) plus an auto-generated .aspx.designer.cs control-declaration file |
| Supported code languages | C# and VB.NET; J# was supported in early .NET Framework versions but discontinued with Visual Studio 2008 |
| Page directive syntax | <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Page.aspx.cs" Inherits="Namespace.Page" %> |
| Server controls | Built-in <asp:*> Web Server Controls (e.g. <asp:Button>, <asp:GridView>, <asp:TextBox>) rendered as HTML at runtime |
| ViewState | Page and control state persisted between postbacks in a hidden form field named __VIEWSTATE (Base64-encoded binary serialization) |
| Page lifecycle | Fixed event sequence: PreInit → Init → Load → Control events → PreRender → SaveViewState → Render → Unload |
| Compilation model | JIT-compiled to a .NET assembly on first request; cached in the Temporary ASP.NET Files directory |
| Hosting requirement | Requires IIS on Windows (or Mono on Linux/macOS); ASP.NET Web Forms are not included in ASP.NET Core (.NET 5+) |
| Event model | Postback-driven: form submissions trigger server-side event handlers (e.g. Button_Click) via HTTP POST back to the same page |
| Master pages | Layout templates stored in .master files; referenced via MasterPageFile="~/Site.master" in the <%@ Page %> directive |
| Session and state | Built-in server-side Session object (Session["key"]), Application state, and integrated Forms Authentication via web.config |
| Released | 2002 (ASP.NET 1.0, .NET Framework) |
| Specification | learn.microsoft.com |
ASPX conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about ASPX files.