Skip to content

Web application Basics

πŸ”· What is a Web Application?

A web application is a software program that runs on a web server and is accessed by users through a web browser using the internet or an intranet.

Unlike traditional desktop applications, web applications do not need to be installed on a user’s machine.


πŸ”· Components of a Web Application

  1. Client (Front-End)

  2. Runs in the user's browser

  3. Built using HTML, CSS, JavaScript
  4. Handles user input, interactions, and display

  5. Server (Back-End)

  6. Processes business logic

  7. Communicates with the database
  8. Returns data or web pages to the client

  9. Database

  10. Stores user data, content, and application state

  11. Commonly used databases: SQL Server, MySQL, Oracle, MongoDB

πŸ”· Types of Web Applications

Type Description
Static Web App Delivers fixed content (e.g., HTML pages)
Dynamic Web App Generates content dynamically (e.g., ASP.NET)
Single Page Application (SPA) Loads a single HTML page and updates dynamically (e.g., React, Angular)
Progressive Web App (PWA) Works like a native app, supports offline use

πŸ”· Web Application vs Desktop Application

Feature Web Application Desktop Application
Installation Not required Required
Accessibility Accessible via browser Runs on specific machine
Update & Maintenance Easier (centralized server) Harder (needs manual update)
Performance Depends on internet & server High performance on local machine

πŸ”· ASP.NET for Web Development

ASP.NET is a framework developed by Microsoft for building dynamic web applications using .NET languages like VB.NET or C#.

Features:

  • Server-side processing
  • Web Forms and MVC support
  • Session and state management
  • Security features like authentication and authorization
  • Rich set of controls and libraries

πŸ”· Life Cycle of a Web Application Request

  1. Request: Browser sends an HTTP request to the server.
  2. Routing: Server routes the request to the correct handler (e.g., a .aspx file or controller).
  3. Processing: Code runs on the server; data is fetched from DB if needed.
  4. Response: Server returns an HTML response to the browser.
  5. Rendering: Browser displays the result to the user.

πŸ”· Tools Used for Web Development

  • Visual Studio: For ASP.NET development
  • IIS (Internet Information Services): Web server for running ASP.NET apps
  • Web Browsers: Chrome, Firefox, Edge for testing UI
  • SQL Server: Database backend

πŸ”· Advantages of Web Applications

  • Platform independent (runs in any browser)
  • Centralized updates and deployment
  • Easy access from anywhere
  • Scalable and maintainable
  • Cross-device compatibility

πŸ”· Real-Life Examples

  • Gmail
  • Online banking portals
  • E-commerce websites like Amazon
  • Online reservation systems
  • College/student portals

πŸ“Œ Summary:

  • A web application runs on a server and is accessed via a web browser.
  • It has three main parts: Client, Server, and Database.
  • ASP.NET is widely used to develop .NET-based web apps.
  • Web apps are easier to maintain and update compared to desktop apps.

Web Application Fundamentals

πŸ”· What Are Web Application Fundamentals?

Web application fundamentals refer to the core concepts, architecture, and technologies that are essential for building and running web-based applications. Understanding these basics is crucial for developing reliable, scalable, and user-friendly web apps.


πŸ”Ά 1. Web Application Architecture

A typical web application is based on the Client-Server Model, consisting of:

Component Role
Client (Frontend) User interface part (runs in the web browser)
Server (Backend) Handles business logic and processes client requests
Database Stores data (like users, orders, etc.)

πŸ”Ά 2. HTTP Protocol

  • Web apps communicate using HTTP (HyperText Transfer Protocol) or HTTPS (secure).
  • It is a stateless protocol, meaning each request is independent and doesn’t remember previous interactions.

Common HTTP Methods:

Method Purpose
GET Retrieve data
POST Submit data
PUT Update existing data
DELETE Remove data

πŸ”Ά 3. URL and Routing

  • Each web page or functionality has a unique URL (Uniform Resource Locator).
  • Routing maps a URL to specific code (e.g., a page or a controller method in ASP.NET).

Example: https://myapp.com/products β†’ Products.aspx or ProductsController.cs


πŸ”Ά 4. Frontend Technologies

The frontend is what the user sees and interacts with. It includes:

Technology Purpose
HTML Structure of the page
CSS Styling and layout
JavaScript Interactivity and client-side logic

Modern frameworks: React, Angular, Vue


πŸ”Ά 5. Backend Technologies

Backend processes requests, performs logic, and communicates with databases.

  • In .NET, backend can be built using:

  • ASP.NET Web Forms

  • ASP.NET MVC
  • ASP.NET Core

It handles:

  • Authentication
  • Business logic
  • Database communication
  • Session management

πŸ”Ά 6. Databases

Web apps often need to store and retrieve data. Common databases:

Type Example
Relational SQL Server, MySQL
NoSQL MongoDB

In .NET apps, ADO.NET or Entity Framework is used to interact with databases.


πŸ”Ά 7. State Management

Since HTTP is stateless, web apps use state management to remember user information across pages.

Technique Description
Session State Stores data for one user session
Cookies Small pieces of data stored in the browser
ViewState Stores control values between postbacks (Web Forms)
Query Strings Passes data via URL parameters

πŸ”Ά 8. Security Fundamentals

Web apps must handle security properly. Common measures:

Security Feature Purpose
Authentication Verifies user identity (login system)
Authorization Controls what the user can access
Input Validation Prevents SQL injection, XSS, etc.
HTTPS Encrypts communication

πŸ”Ά 9. Development Environment

  • Visual Studio: IDE for developing ASP.NET applications
  • IIS (Internet Information Services): Web server for running .NET web apps
  • .NET Framework / .NET Core: Runtime for executing .NET applications

πŸ”Ά 10. Deployment

Web applications are deployed to a web server (like IIS or Azure App Service). Users access it via a browser from anywhere.


πŸ“Œ Summary Table

Concept Description
Web app architecture Client-server + database
HTTP Stateless communication protocol
Frontend HTML, CSS, JavaScript
Backend ASP.NET handles logic
Routing Maps URLs to code
Database Stores persistent data
State management Maintains user data across pages
Security Protects against threats
Tools Visual Studio, IIS
Deployment Hosting the web app

ASP.NET Application Fundamentals

πŸ”· What is ASP.NET?

ASP.NET is a web application framework developed by Microsoft that allows developers to build dynamic websites, web applications, and web services using .NET languages like VB.NET or C#.

It runs on the .NET Framework (or .NET Core/.NET 5+ in newer versions) and uses the HTTP protocol to communicate between browser (client) and web server.


πŸ”· ASP.NET Application Structure

An ASP.NET web application typically includes:

Component Description
.aspx pages Web Forms with HTML UI and server-side logic
.aspx.cs or .vb Code-behind files (written in C# or VB.NET)
web.config Configuration settings (e.g., security, session, database)
Global.asax Global application events like start, end, error
App_Code folder Shared classes and utility functions
App_Data folder Databases or data files used by the application

πŸ”· ASP.NET Page Life Cycle

Each time a user requests a page, the ASP.NET engine follows a life cycle:

Stage Description
Page Request Client requests a .aspx page
Start Sets properties like IsPostBack
Initialization Controls are initialized (ID set)
Load Loads control properties and view state
PostBack Events Executes user events like button clicks
Rendering Page is converted to HTML
Unload Final cleanup and memory release

πŸ”· Server-Side vs Client-Side

Server-Side (ASP.NET) Client-Side (Browser)
Code executes on server Code executes on user’s browser
Uses C# / VB.NET Uses JavaScript / HTML / CSS
Secure and hidden Visible and editable in browser
Can connect to database Cannot directly connect to database

πŸ”· Web Forms in ASP.NET

  • Built using .aspx pages and controls
  • Drag-and-drop controls from the toolbox (e.g., Button, Label, GridView)
  • Use runat="server" to make controls accessible in code-behind
  • Event-driven (e.g., Button_Click)

Example:

<asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" />

Code-behind:

protected void btnSubmit_Click(object sender, EventArgs e)
{
    lblMessage.Text = "Submitted!";
}

πŸ”· Key ASP.NET Features

Feature Description
State Management Maintains user data using Session, ViewState, Cookies
Validation Controls Validates input (e.g., RequiredFieldValidator)
Master Pages Provides consistent layout for multiple pages
Themes and Skins Provides styling for controls and pages
Data Binding Connects controls like GridView to databases
Security Login controls, roles, membership providers

πŸ”· Configuration with web.config

  • Central XML file to store settings

Examples:

  • Database connection strings
  • Authentication rules
  • Custom error pages
  • Session settings
<connectionStrings>
  <add name="MyDB" connectionString="Data Source=..."/>
</connectionStrings>

πŸ”· ASP.NET Compilation Model

  • Pages are compiled into assemblies (DLLs) the first time they are accessed.
  • Faster execution after first request.

πŸ”· Deployment Options

  • IIS (Internet Information Services): Microsoft’s web server for hosting ASP.NET apps
  • Azure Web Apps: Cloud deployment for ASP.NET
  • FTP / Web Deploy: Traditional file transfer

πŸ“Œ Summary Table

Feature Description
ASP.NET Framework for building web apps using .NET
Page Life Cycle Series of events from request to response
Web Forms Visual, event-driven pages using controls
web.config Stores app settings
State Management Session, ViewState, Cookies
Deployment Via IIS, Azure, or other hosts