Client Server Architecture in ASP.NET | BCA Sem 5 Unit 1 Notes | BKNMU

BCA Sem 5  |  Unit 1  |  ASP.NET

Client Server Architecture

How does the Internet actually work behind the scenes? Let's find out!

BKNMU Junagadh NEP 2020 Web Technology Networking Basics
In simple words: Client-Server Architecture is a model where one computer (the client) asks for something, and another computer (the server) provides it. Just like a customer ordering food at a restaurant — the customer is the client, and the kitchen is the server.
📖 What is Client-Server Architecture?

Every time you open a website — say google.com — your browser sends a message to Google's computer asking for the page. Google's computer sends the page back. This simple exchange is the heart of Client-Server Architecture.

It is a computing model in which tasks and workloads are divided between two types of computers:

  • Client — the computer that requests a service or resource.
  • Server — the computer that provides the service or resource.

In ASP.NET web development, the browser is the client and the IIS web server running ASP.NET is the server.

🖥️ Client vs Server — Key Differences

💻 Client

  • Sends requests to the server
  • Runs on user's machine (browser, app)
  • Displays the response to the user
  • Examples: Chrome, Firefox, Mobile App
  • Handles UI — what user sees
  • Needs internet to communicate
  • Also called Front-end

🖧 Server

  • Receives and processes requests
  • Runs on a powerful remote machine
  • Sends back data or HTML response
  • Examples: IIS, Apache, Nginx
  • Handles logic + database
  • Runs 24/7, always listening
  • Also called Back-end
🏗️ How Client-Server Works — Visual Flow

Request-Response Cycle in Client-Server Model

💻 ClientBrowser / App
🌐 InternetHTTP / HTTPS
🖧 Web ServerIIS + ASP.NET
🗄️ DatabaseSQL Server

① Client sends HTTP Request  →  ② Server processes  →  ③ Fetches data from DB

💻 ClientShows HTML Page
🌐 InternetHTML Response
🖧 Web ServerGenerates HTML
🗄️ DatabaseReturns Data

④ DB sends data back  →  ⑤ Server builds HTML  →  ⑥ Client displays page

🔄 Step-by-Step: What Happens When You Open a Website?
1

You type a URL in the browser

Example: http://bcaschool.blogspot.com — browser creates an HTTP Request.

2

DNS lookup

The browser finds the server's IP address using the Domain Name System (DNS). Like finding a phone number from a name.

3

Request travels over the Internet

The HTTP/HTTPS request packet travels through routers and reaches the web server.

4

Server receives and processes the request

IIS hands it to ASP.NET. ASP.NET runs your C# code — maybe fetches data from SQL Server database.

5

Server generates HTML response

ASP.NET builds the final HTML page with dynamic data and sends it back as an HTTP Response.

6

Browser renders the page

Your browser receives the HTML + CSS + JS and displays the final webpage on your screen.

📦 Types of Client-Server Architecture

1-Tier Architecture

Client, server, and database are all on the same machine. Used for small standalone apps. Example: MS Access database app on your PC.

2-Tier Architecture

Client directly talks to the server/database. No middle layer. Simple and fast but hard to scale. Example: Desktop app connecting directly to SQL Server.

3-Tier Architecture

Presentation + Logic + Data on separate layers. Most common in web development. Example: Browser → ASP.NET → SQL Server.

N-Tier Architecture

Multiple layers — used in large enterprise applications. Extra layers for caching, API gateway, microservices. Example: Amazon, Google.

🔍 3-Tier Architecture in Detail (Most Important for ASP.NET)
ℹ️ Why 3-Tier? ASP.NET Web Applications mostly use 3-Tier Architecture. It separates the Presentation, Business Logic, and Data layers — making the app easier to manage, scale, and secure.
Tier Also Called What It Does ASP.NET Example
1st Tier Presentation Layer What the user sees — UI and forms .aspx pages, HTML, CSS, JavaScript
2nd Tier Business Logic Layer Rules and processing of the app C# code-behind files, .cs classes
3rd Tier Data Access Layer Stores and retrieves data from DB ADO.NET, SQL Server, Entity Framework
📡 Protocols Used in Client-Server Communication
ProtocolFull FormUsed For
HTTPHyperText Transfer ProtocolNormal web page requests
HTTPSHTTP SecureEncrypted, secure web requests
FTPFile Transfer ProtocolUploading/downloading files
SMTPSimple Mail Transfer ProtocolSending emails
TCP/IPTransmission Control Protocol / IPCore internet communication
✅ Advantages & Disadvantages
Advantages ✅Disadvantages ❌
Centralized data — easy to manage and backup Server failure affects all clients
Easy to scale — add more clients anytime Requires network connection always
Security is easier to implement at server side Server can become a bottleneck under heavy load
Multiple clients can share the same server Server setup and maintenance is costly
Updates only needed on the server Network latency can slow down performance
💻 Client-Server in ASP.NET — Real Example

When a user submits a login form on an ASP.NET page, here is what happens:

Client side (.aspx — what user sees):

<!-- This HTML runs on CLIENT (Browser) --> <asp:TextBox ID="txtUser" runat="server" /> <asp:TextBox ID="txtPass" runat="server" TextMode="Password" /> <asp:Button ID="btnLogin" runat="server" Text="Login" OnClick="btnLogin_Click" />

Server side (.aspx.cs — runs on SERVER):

// This C# code runs on SERVER (IIS + ASP.NET) protected void btnLogin_Click(object sender, EventArgs e) { string user = txtUser.Text; string pass = txtPass.Text; // Check in database (server-side logic) if (user == "admin" && pass == "1234") Response.Redirect("Dashboard.aspx"); else lblMsg.Text = "Invalid credentials!"; }
💡 Key Point: The .aspx file (HTML/controls) is sent to the client browser. The .aspx.cs file (C# code) always runs on the server — the client never sees it. This is the essence of client-server separation in ASP.NET!
📝 Quick Revision — Key Points for Exam
  • Client-Server is a model where client requests and server responds.
  • Client = Browser (Front-end)  |  Server = IIS + ASP.NET (Back-end).
  • Communication happens via HTTP / HTTPS protocol.
  • 1-Tier: Everything on one machine.
  • 2-Tier: Client directly talks to DB — no middle layer.
  • 3-Tier: Presentation → Business Logic → Data (most used in ASP.NET).
  • N-Tier: Many layers for large enterprise apps.
  • ASP.NET uses 3-Tier Architecture — .aspx (UI) + .cs (Logic) + SQL Server (Data).
  • Server processes all logic; client only displays the final HTML.
  • Advantages: Centralized, scalable, secure. Disadvantage: Server failure = all down.

Post a Comment

Thanks for comment.

Previous Post Next Post