What WebMatrix Provides
WebMatrix is a free, lightweight IDE Microsoft released specifically to make ASP.NET Web Pages accessible to beginners, bundling a code editor, a built-in lightweight web server (IIS Express), a SQL Server Compact database editor, and one-click publishing to a hosting provider all in a single small download. Unlike full Visual Studio, WebMatrix starts up quickly, has a simplified interface with just Files, Databases, and Reports workspaces, and includes a gallery of starter site templates for blogs and small e-commerce sites that you can install with a couple of clicks.
Cricket analogy: WebMatrix is like a compact backyard cricket set with a plastic bat, stumps, and a tennis ball that lets a kid start playing in minutes, compared to needing a full turf ground, professional kit, and groundstaff before Test cricket can begin.
The Default Folder Layout
MySite/
_AppStart.cshtml (runs once when the site starts)
Default.cshtml (maps to the site root, "/")
About.cshtml (maps to "/About")
Contact.cshtml (maps to "/Contact")
App_Data/
MySite.sdf (SQL Server Compact database file)
App_Start/
(optional bootstrapping code files)
Account/
Login.cshtml
Register.cshtml
Shared/
_SiteLayout.cshtml (shared layout page)
_Logo.cshtml (reusable partial)
Scripts/
site.js
Content/
site.cssA WebMatrix project has no strict requirement for a src folder or project file the way a compiled .NET project does; instead, the folder structure itself is the site, and ASP.NET's runtime resolves requests by matching the URL to a file path. App_Data is a special, protected folder that IIS never serves directly to browsers, making it the conventional home for a SQL Server Compact .sdf database file or any other data files that must never be publicly downloadable. _AppStart.cshtml, if present, runs exactly once when the application first starts, which is the typical place to call WebSecurity.InitializeDatabaseConnection() to wire up the built-in membership system used by the Account folder's login and registration pages.
Cricket analogy: App_Data acts like the dressing room at a stadium, off-limits to spectators in the stands even though it's physically part of the ground, just as App_Data is part of the site but never served to visiting browsers.
IIS and ASP.NET are configured by default to block direct HTTP access to files inside App_Data, App_Start, and Bin folders, which is why database files and configuration assemblies belong there rather than in a publicly reachable folder.
Running the Site with IIS Express
When you click Run in WebMatrix, it launches IIS Express, a lightweight, self-contained version of IIS that doesn't require administrator installation on the whole machine, and opens the default browser pointed at a localhost address with a dynamically assigned port such as http://localhost:12345. This gives you an accurate preview of how the site will behave under a real IIS-compatible server, including things like the App_Data protection rules and the ASP.NET request pipeline, which is more representative than a generic static file server would be.
Cricket analogy: IIS Express is like a practice net with proper turf pitch behavior set up on the side of the main ground, giving a batter a realistic feel for match conditions without booking the full stadium.
IIS Express is a development-time server bound to localhost. It is not intended for production hosting; when you deploy a WebMatrix site, you publish it to a real IIS server or a hosting provider that supports ASP.NET.
- WebMatrix is a free, lightweight IDE bundling an editor, IIS Express, a database tool, and one-click publishing.
- A Web Pages project's folder structure directly determines its site's URL structure; there's no separate project file.
- App_Data is a protected folder that IIS never serves directly, ideal for SQL Server Compact .sdf database files.
- _AppStart.cshtml runs once at application startup, typically used to initialize the WebSecurity membership system.
- The Account folder conventionally holds Login.cshtml and Register.cshtml for the built-in membership provider.
- IIS Express is a self-contained development server that previews the site under realistic ASP.NET conditions.
- IIS Express is for local development only and is not meant for production hosting.
Practice what you learned
1. What is WebMatrix primarily designed to provide?
2. Why is the App_Data folder used for the site's SQL Server Compact database file?
3. When does _AppStart.cshtml execute?
4. What server does WebMatrix use to run and preview a site locally?
5. Is IIS Express suitable for production hosting?
Was this page helpful?
You May Also Like
What Is ASP.NET Web Pages?
An introduction to ASP.NET Web Pages, a lightweight framework that mixes server-side C# or VB.NET code directly into HTML using Razor syntax, aimed at simple, file-based site development.
Layout Pages in Web Pages
How shared layout pages, the RenderBody and RenderSection methods, and reusable partial views let ASP.NET Web Pages sites keep a consistent header, footer, and navigation across many content pages.
Razor Syntax in Web Pages
A practical guide to the Razor markup syntax that lets you embed C# or VB.NET code inline with HTML using the @ symbol, including expressions, code blocks, loops, and conditionals.
Helpers in Web Pages
How built-in and custom helpers provide reusable, prebuilt pieces of functionality, from Chart and WebGrid to WebMail and Facebook integration, plus how to write your own helper with @helper.
Related Reading
Related Study Notes in Microsoft Technologies
Browse all study notesWindows 10 / UWP Development Study Notes
.NET · 30 topics
Microsoft TechnologiesWindows Batch Scripting Study Notes
Batch · 30 topics
Microsoft TechnologiesMFC (Microsoft Foundation Classes) Study Notes
C++ · 30 topics
Microsoft TechnologiesSilverlight Study Notes
.NET · 30 topics
Microsoft TechnologiesXAML Study Notes
.NET · 30 topics
Microsoft TechnologiesWPF (Windows Presentation Foundation) Study Notes
.NET · 30 topics