Types of Files in ASP.NET Explained | BCA Sem 5 Unit 1 Notes | BKNMU

BCA Sem 5  |  Unit 1  |  ASP.NET



Types of Files in ASP.NET

Every extension has a purpose — here's what each ASP.NET file actually does

BKNMU Junagadh NEP 2020 Web Forms Project Structure
In simple words: When you create an ASP.NET project, Visual Studio generates many different file types — each with its own job. Some hold the design (UI), some hold the logic (code), and some hold settings (configuration). Knowing what each file does helps you understand the whole project structure.
📖 Why Does ASP.NET Have So Many File Types?

Unlike a simple HTML website with just .html files, an ASP.NET application separates design, logic, configuration, and data into different files. This makes large projects easier to manage, debug, and update — a key idea behind ASP.NET's architecture.

🌳 A Typical ASP.NET Project Structure
📁 MyWebApp/
  ├── Default.aspx  // UI design page
  ├── Default.aspx.cs  // Code-behind logic
  ├── Site.master  // Master/layout page
  ├── Global.asax  // App-level events
  ├── Web.config  // App settings
  ├── 📁 App_Data/  // Database files (.mdf)
  ├── 📁 Scripts/  // .js files
  ├── 📁 Styles/  // .css files
  └── 📁 bin/  // Compiled .dll files

1️⃣ Page & Code Files

.aspx

Web Form Page

Contains the HTML and server controls — the design/UI part of a page.

.aspx.cs

Code-Behind File (C#)

Contains the C# logic for the .aspx page — event handlers, business logic.

.aspx.vb

Code-Behind File (VB)

Same as above, but written in VB.NET instead of C#.

.cs / .vb

Class Files

Plain C# or VB.NET classes used for reusable logic across the app.

2️⃣ Configuration Files

.config

Web.config

Stores app settings, connection strings, security rules, and custom errors.

.asax

Global.asax

Handles application-level events like Application_Start, Session_Start.

.sln

Solution File

Used by Visual Studio to organize one or more related projects together.

.csproj

Project File

Contains project settings, references, and a list of all included files.

3️⃣ Data & Service Files

.mdf

SQL Server Database

Local SQL Server database file, often stored inside App_Data folder.

.xml

XML Data File

Stores structured data, often used with datasets or configuration.

.asmx

Web Service File

Defines a traditional SOAP-based ASP.NET Web Service.

.svc

WCF Service File

Defines a Windows Communication Foundation (WCF) service endpoint.

4️⃣ Design & Asset Files

.master

Master Page

Defines a common layout (header, footer, menu) shared across multiple pages.

.css

Stylesheet

Controls the visual styling — colors, fonts, layout — of your web pages.

.js

JavaScript File

Adds client-side interactivity — validation, animations, AJAX calls.

.skin

Skin File

Defines themes — predefined appearance settings for server controls.

5️⃣ Special & Compiled Files

.ascx

User Control

A reusable mini-page (like a header or login box) that can be embedded anywhere.

.dll

Compiled Assembly

Compiled binary code stored in the bin folder — the "built" version of your project.

.resx

Resource File

Stores text, images, or strings — often used for multi-language support.

.sitemap

Site Map File

Defines the navigation structure of the website for menus and breadcrumbs.

📋 Complete Quick-Reference Table
ExtensionFile Name ExamplePurpose
.aspxDefault.aspxWeb Form page — UI design
.aspx.csDefault.aspx.csCode-behind file (C#)
.masterSite.masterShared layout/master page
.ascxHeader.ascxReusable user control
.asaxGlobal.asaxApplication-level event handling
.configWeb.configApp settings & configuration
.asmxService.asmxSOAP Web Service
.svcService.svcWCF Service
.mdfDatabase.mdfSQL Server database file
.sitemapWeb.sitemapSite navigation structure
.skinDefault.skinControl appearance/theme
.resxStrings.resxResource/localization data
.dllMyWebApp.dllCompiled assembly
.slnMyWebApp.slnVisual Studio solution file
.csprojMyWebApp.csprojProject configuration file
ℹ️ Important: The .aspx and .aspx.cs files always work together as a pair — .aspx is the "face" (UI) and .aspx.cs is the "brain" (logic) of the same page.
💻 How .aspx and .aspx.cs Connect

Notice the CodeFile attribute — this is what links the two files together:

<!-- Default.aspx --> <%@ Page Language="C#" CodeFile="Default.aspx.cs" Inherits="_Default" %>
💡 Tip: If you ever see an error like "Could not load type '_Default'", it usually means the .aspx file and .aspx.cs file are not properly linked through the CodeFile and Inherits attributes.
📝 Quick Revision — Key Points for Exam
  • .aspx = Web Form page (UI)  |  .aspx.cs = Code-behind (logic).
  • .master = Master Page for shared layout across multiple pages.
  • .ascx = User Control — a reusable mini component.
  • .asax = Global.asax — handles application-level events.
  • .config = Web.config — stores settings & connection strings.
  • .asmx = SOAP Web Service  |  .svc = WCF Service.
  • .mdf = SQL Server database file, usually in App_Data folder.
  • .dll = Compiled code, stored in the bin folder.
  • .sln and .csproj manage the overall Visual Studio project.
  • Each file type keeps the project organized — separating design, logic, config, and data.

Post a Comment

Thanks for comment.

Previous Post Next Post