Visual Programming Tools R301
Visual Programming Tools R301
The Internet is a giant network that connects computers, mobile phones, and other devices
worldwide. It helps people communicate, search for information, watch videos, shop online, and
much more.
• In the 1960s, the U.S. government started a project called ARPANET to connect computers
for research.
• In the 1980s, scientists created a system called the Domain Name System (DNS) to make
websites easier to find.
• In the 1990s, Tim Berners-Lee invented the World Wide Web (WWW), which made the
Internet easy to use.
• Today, billions of people use the Internet for learning, business, entertainment, and
socializing.
1. Connected Devices: Phones, computers, and other gadgets connect to the Internet.
2. IP Address: Every device has a unique number called an IP address (like a home address) to
find and send information.
3. Websites & Data: Websites are stored on special computers called servers.
4. Internet Protocols: Rules like HTTP, TCP/IP, and DNS help send and receive information.
5. Packets: Information is broken into small parts called packets, sent through the Internet,
and put back together at the destination.
Broadband (DSL, Cable, Fiber) Fast Internet via wired connections 10 Mbps – 1 Gbps
Mobile Data (3G, 4G, 5G) Internet for smartphones 1 Mbps – 10 Gbps
• IoT (Internet of Things): Smart home devices like Alexa and Google Home.
!! figure !!!
plaintext
CopyEdit
+----------------------+-----------------------------------------------------------+
| Topic | Description |
+----------------------+-----------------------------------------------------------+
| Who Invented It? | Developed from ARPANET in the 1960s by the U.S. Department of Defense. |
| How It Works? | Uses protocols like TCP/IP to transmit data between computers. |
| Key Components | Web, Email, Cloud Computing, IoT, Social Media, E-commerce. |
| Types of Internet | Wired (Fiber, DSL, Ethernet), Wireless (Wi-Fi, Mobile Data, Satellite). |
+----------------------+-----------------------------------------------------------+
- Example:
- You type www.youtube.com in your browser.
- The browser sends a request to the YouTube web server.
- The server processes the request and sends back the homepage data.
- The browser displays the YouTube homepage.
-
- 4. Components of the Client-Server Model
- 1. Web Client Components
◼ Component ◼ Description
◼ Internet ◼ Needed to send and receive requests from the web server.
Connection
◼ IP Address ◼ A unique number that identifies the device on the Internet.
◼ Cloud Web Server ◼ Hosted on cloud platforms like AWS, Google Cloud, Azure.
-
- 6. Communication Protocols in Client-Server Model
◼ Protocol ◼ Function
│ │
│---------------------------------------------->│
│---------------------------------------------->│
│<----------------------------------------------│
│---------------------------------------------->│
│---------------------------------------------->│
Web client and server communication rely on different protocols (rules) to send and receive data.
These protocols ensure that data transfer is secure, efficient, and reliable.
• How It Works:
• Example: When you visit http://example.com, your browser requests the page using HTTP.
• How It Works:
o TCP: Breaks data into packets, sends them, and ensures they arrive correctly.
• Example: When you request https://google.com, TCP/IP ensures the data reaches Google’s
servers and back to your device.
• Port: 53
• How It Works:
o The browser asks the DNS server for the IP address of a website.
• Example: When you type www.facebook.com, DNS finds the correct IP (69.63.176.13) and
directs your browser there.
• Example: A website administrator uploads files to a web server using FTP software like
FileZilla.
• Example: When you send an email via Gmail, SMTP transfers your email from Gmail’s client
to its server.
7. IMAP (Internet Message Access Protocol) & POP3 (Post Office Protocol 3)
• Ports:
• Example: IMAP allows you to check emails from multiple devices, while POP3 downloads
them to your device.
8. WebSockets
REST (Representational State Uses HTTP methods (GET, POST, PUT, Web APIs (e.g., Google
Transfer) DELETE) to exchange data. Maps API)
SOAP (Simple Object Access A stricter, XML-based protocol for secure Banking and enterprise
Protocol) data exchange. applications
SSH (Secure Shell Securely connects to remote System administration, secure file
22
Protocol) servers. transfer
SOAP API Secure API data exchange Uses HTTP & XML Banking, enterprise apps
Conclusion
!! figure !!!
plaintext
CopyEdit
+------------------+---------------------------+-----------------------------+--------------------------+
+------------------+---------------------------+-----------------------------+--------------------------+
| IMAP/POP3 | Retrieves emails | 143, 993 (IMAP), 110, 995 (POP3) | Reading emails |
| REST API | Web-based API communication | Uses HTTP methods | Connecting apps &
services |
| SOAP API | Secure API data exchange | Uses HTTP & XML | Banking, enterprise apps |
+------------------+---------------------------+-----------------------------+-------------------
What is IIS?
IIS (Internet Information Services) is a web server developed by Microsoft for hosting websites,
applications, and services on Windows Server. It processes and delivers web content over the
internet or intranet using standard protocols such as HTTP, HTTPS, FTP, SMTP, and WebSockets.
• The IIS server receives the HTTP/HTTPS request from the browser.
4️⃣ IIS Processes the Request
• IIS checks:
Website Configuration
Application Pools
Authentication & Security
Web Content Files (HTML, CSS, JS, etc.)
5️⃣ IIS Sends a Response
• IIS delivers the requested webpage (HTML, CSS, JavaScript) to the browser.
6️⃣ Browser Displays Webpage
Component Description
Application Pools Isolates web apps for better security and performance.
HTTP/HTTPS Support Handles secure (HTTPS) and non-secure (HTTP) web traffic.
Features of IIS
Performance High for Windows apps Good Best for high traffic
Scalability Scales well with Windows Good Best for load balancing
+----------------------+--------------------------------------------------------+
| Component | Description |
+----------------------+--------------------------------------------------------+
| Application Pools | Isolates web apps for **better security and performance**. |
| HTTP/HTTPS Support | Handles **secure (HTTPS) and non-secure (HTTP) web traffic**. |
Think of the .NET Framework as a toolbox provided by Microsoft to help developers build different
types of applications. It gives developers ready-made tools, libraries, and a special engine (CLR –
Common Language Runtime) to run applications smoothly on Windows.
FCL (Framework Class Library) A collection of pre-made tools (like ready-to-use Lego pieces)
Real-Life Example
Imagine you want to build a car (software application). The .NET Framework provides:
Engine (CLR) – Runs the car (application)
Spare Parts (Libraries) – Pre-built tools to build the car faster
Security System – Ensures safety while driving
plaintext
CopyEdit
+----------------------------+----------------------------------------------------------+
| Step | Description |
+----------------------------+----------------------------------------------------------+
| 1️⃣ Write Code | Developer writes code using **C#, VB.NET, or F#**. |
| 2️⃣ Compile Code | Code is converted into **Microsoft Intermediate Language (MSIL)**. |
| 3️⃣ Use .NET Libraries | Uses pre-built libraries (FCL) to add features like UI, database, etc. |
| 4️⃣ CLR Executes Code | The **Common Language Runtime (CLR)** compiles MSIL into machine
code. |
| 6️⃣ Application Runs | The application runs on **Windows OS** with .NET support. |
+----------------------------+----------------------------------------------------------+
Think of CLR (Common Language Runtime) as the engine of the .NET Framework. It is responsible
for running .NET applications by converting the code into something the computer understands.
Real-Life Example
Imagine CLR as a translator in a conversation:
You speak in English (C# code)
The translator converts it into another language (MSIL)
The listener (computer) understands and responds (Machine Code)
!! figure !!
plaintext
CopyEdit
+--------------------------+------------------------------------------------------+
| Step | Description |
+--------------------------+------------------------------------------------------+
| 2️⃣ Compile Code | The code is compiled into **MSIL (Intermediate Language)**. |
| 3️⃣ CLR Loads Code | CLR loads the **MSIL code** for execution. |
| 4️⃣ JIT Compilation | **Just-In-Time (JIT) Compiler** converts MSIL to **machine code**. |
| 5️⃣ Code Execution | The machine code runs on the **computer processor**. |
| 6️⃣ Memory Management | **Garbage Collector (GC)** removes unused objects automatically. |
| 7️⃣ Security & Error Handling | CLR checks for **security threats and errors** while running. |
+--------------------------+------------------------------------------------------+
The Framework Class Library (FCL) is a collection of pre-built code (libraries) in the .NET
Framework that helps developers write programs faster and easier. Instead of writing everything
from scratch, developers can use ready-made functions for common tasks like:
File handling
Database access
Networking
User interface design
Security
When a program runs, it uses memory to store data. If memory is not freed after use, it can slow
down the application or even crash it.
Garbage Collection (GC) is a feature of the Common Language Runtime (CLR) that automatically
cleans up unused memory to keep the program efficient.
Generation Description
Think of MSIL (Microsoft Intermediate Language) as a middle step between writing code and
running it on a computer.
When you write a program in C#, VB.NET, or F#, the .NET compiler does not directly convert it into
machine code. Instead, it first turns it into MSIL, which is a special code that can run on any system
with .NET installed.
Later, when the program runs, the Common Language Runtime (CLR) uses a JIT (Just-In-Time)
Compiler to convert MSIL into machine code that the computer understand
plaintext
CopyEdit
+----------------------+------------------------------------------------------+
| Step | Description |
+----------------------+------------------------------------------------------+
| 3️⃣ Store in DLL/EXE | The compiled MSIL is stored in a **.DLL or .EXE file**. |
| 4️⃣ JIT Compilation | The **JIT (Just-In-Time) Compiler** converts MSIL to **machine code**. |
| 5️⃣ Execute Program | The application runs on the **computer processor**. |
+----------------------+------------------------------------------------------+
plaintext
CopyEdit
▼
Compiler (C# Compiler, VB Compiler)
▼
MSIL (Intermediate Language)
▼
CLR (Common Language Runtime)
▼
JIT Compiler (Just-In-Time)
▼
Machine Code (Runs on CPU)
+---------------------------+------------------------------------------------------+
| Step | Description |
+---------------------------+------------------------------------------------------+
| 1️⃣ Client Request | The client (browser, mobile app) sends a request. |
| 2️⃣ Web Service Receives | The web service (API) processes the request. |
| 3️⃣ Database Access | The web service fetches data from a database. |
| 4️⃣ Response Created | The web service formats data (JSON, XML). |
| 5️⃣ Response Sent | The web service sends the response back to the client. |
| 6️⃣ Client Displays Data | The client application processes and shows data.
What is ASP.NET?
ASP.NET is a web development framework created by Microsoft for building websites, web
applications, and web services. It allows developers to create dynamic, fast, and secure web
applications using C# or VB.NET.
+----------------------+
+---------+------------+
+----------------------+
+---------+------------+
|
v
+----------------------+
| Processes request |
+---------+------------+
+----------------------+
+---------+------------+
+----------------------+
| HTML/CSS/JS generated|
+---------+------------+
+----------------------+
+----------------------+
Tag Format Standard HTML tags (<input>, <button>). Special tags (<asp:Button>).
State
Loses data on page refresh. Can maintain state using ViewState.
Management
Use HTML Controls for simple, static pages that don’t need server-side processing.
Use ASP.NET Controls for dynamic pages that require data handling, validation, and interaction
with databases.
+---------------------------+
+---------------------------+
+---------------------------+
| (Primitive or Non-Primitive) |
+---------------------------+
+---------------------------+
+---------------------------+
+---------------------------+
+---------------------------+
+---------------------------+
| 5️⃣ Store & Use Data |
• Example:
Types of Variables:
• Example:
bool isAdult = (age > 18); // Expression: Checks if age is greater than 18
Types of Expressions:
csharp
CopyEdit
} else
csharp
CopyEdit
csharp
CopyEdit
int day = 3;
switch (day) {
plaintext
CopyEdit
+---------------------------+
+---------------------------+
+---------------------------+
+---------------------------+
+---------------------------+
+---------------------------+
+---------------------------+
+---------------------------+
|
v
+---------------------------+
+---------------------------+
+---------------------------+
+---------------------------+
◼ 1. Operators
Logical &&, `
Example:
csharp
CopyEdit
int a = 10, b = 5;
int sum = a + b; // 15
Example: if-else
csharp
CopyEdit
} else {
Example: switch-case
csharp
CopyEdit
int day = 3;
switch (day) {
For Loop for(int i=0; i<5; i++) Runs a fixed number of times
csharp
CopyEdit
}
Example: while loop
csharp
CopyEdit
int i = 1;
while (i <= 5) {
Console.WriteLine(i);
i++;
Example:
csharp
CopyEdit
Console.WriteLine(numbers[0]); // Output: 10
Example:
csharp
CopyEdit
class Car {
Example:
csharp
CopyEdit
class Animal {
Console.WriteLine(obj.name);
Example:
csharp
CopyEdit
class Person {
p.Name = "John";
Console.WriteLine(p.Name);
Example:
csharp
CopyEdit
class Car {
Console.WriteLine("Car is driving...");
myCar.Drive();
Example:
csharp
CopyEdit
class Car {
brand = brandName;
Console.WriteLine(myCar.brand);
Example:
csharp
CopyEdit
class Example {
Console.WriteLine(globalVar + localVar);
csharp
CopyEdit
Response.Write("Button Clicked!");
plaintext
CopyEdit
+---------------------------+
| (Store data) |
+---------------------------+
+---------------------------+
| (Calculations, Comparisons) |
+---------------------------+
|
+---------------------------+
+---------------------------+
+---------------------------+
+---------------------------+
+---------------------------+
| (Perform actions) |
+---------------------------+
+---------------------------+
| (User interactions) |
+---------------------------+
Web Forms in ASP.NET allow developers to create dynamic web applications using server-side
controls. They work with HTML, CSS, and C# (or VB.NET) to provide an interactive user experience.
CopyEdit
+---------------------------+
+---------------------------+
+---------------------------+
+---------------------------+
+---------------------------+
+---------------------------+
+---------------------------+
+---------------------------+
+---------------------------+
+---------------------------+
|
v
+---------------------------+
+---------------------------+
+---------------------------+
+---------------------------+
The ASP.NET Compilation Model determines how and when the ASP.NET application compiles files
into executable code. This ensures better performance and faster execution when users request a
webpage.
plaintext
CopyEdit
The Code-Behind Model in ASP.NET is a separation of UI and logic, where the HTML design (UI) is
stored in an .aspx file, and the server-side logic (C# or VB.NET code) is in a separate .cs or .vb file.
This approach makes the code easier to maintain, debug, and reuse by keeping the presentation
layer and business logic separate.
plaintext
CopyEdit
ASP.NET Web Forms controls are server-side controls used to create interactive web applications.
These controls generate HTML and JavaScript automatically and handle user input efficiently.
◼ It seems like you’re referring to navigation controls and validation controls, possibly in the
context of UI design or programming. Let me break these down for you:
Navigation Controls
These are user interface elements that allow users to move between different sections or pages of
an application. Examples include:
• Tabs: Allow switching between different content views without navigating away.
• Pagination: Helps divide content into multiple pages with navigation links.
Validation Controls
These are used to ensure that user input meets specific criteria. For example:
• Client-Side Validation: Using JavaScript or HTML5 to validate data in the browser (e.g.,
required attribute in input fields).
• Server-Side Validation: Ensuring data integrity on the server side, regardless of client-side
validation.
Are you working on something specific, such as a web or app interface? Let me know if you'd like
code examples or further details!
Validation groups are a concept often used in software development and frameworks to organize
and apply specific validation rules to particular contexts or scenarios. Instead of applying all
validation rules universally, validation groups allow you to categorize your rules and apply them
selectively based on certain conditions.
For example:
• In a form, you might want to validate only certain fields during user registration and other
fields during profile updates.
• Validation groups can be used in frameworks like Java's Bean Validation (JSR-303) or
.NET's data annotation attributes to specify which validation rules apply to certain
operations or actions.
• You create and associate a group (or multiple groups) with specific validation constraints.
• When performing a validation check, you specify the group(s) that should be considered
for the current context.
Client-side and server-side validation are ways to check if the user’s input is correct before
processing it.
• Happens on the user’s device (browser) before sending data to the server.
• Example: If you leave an email field empty, the browser shows an error message without
sending data to the server.
• Uses backend languages like Python, PHP, Java, or Node.js to check inputs.
• Example: If a user submits a form with an invalid email, the server rejects it and sends an
error message back.
Best Practice:
Always use both client-side and server-side validation! Client-side validation improves user
experience, and server-side validation ensures security.
!! figure !!!
Here's a simple flowchart to explain Client-Side vs. Server-Side Validation:
Flowchart Steps:
2. Client-Side Validation
o If valid → Go to step 3️
4. Server-Side Validation
A Master Page in ASP.NET provides a consistent layout for multiple web pages in a website. It acts
as a template, ensuring that all pages share common elements such as:
• Header
• Navigation bar
• Footer
• Sidebar
Each content page that uses the master page will have its unique content while inheriting the
layout from the master page.
2. Create a Content Page (.aspx) – Inserts specific content into the placeholders.
3. ASP.NET Merges the Two – The Master Page and Content Page combine to generate the
final webpage.
Analogy:
Think of a Master Page as a PowerPoint slide template, and Content Pages as individual slides. The
template remains the same, but each slide (content page) has different text/images.
asp
CopyEdit
<!DOCTYPE html>
<html lang="en">
<head runat="server">
<meta charset="UTF-8">
</head>
<body>
<div class="container">
<div class="header">
<h1>My Website</h1>
</div>
<div class="nav">
<a href="Home.aspx">Home</a>
<a href="About.aspx">About</a>
<a href="Contact.aspx">Contact</a>
</div>
<div class="content">
</div>
<div class="footer">
</div>
</div>
</body>
</html>
Think of it like a template or skin that changes how all pages look without changing their content.
1. CSS Files → For styling elements like fonts, colors, and layout.
2. Skin Files (.skin) → For defining the appearance of controls like buttons, textboxes, etc.
markdown
CopyEdit
/Themes
/DarkTheme
- Style.css
- Controls.skin
- Background.jpg (optional)
Define styles for your theme in the CSS file inside the theme folder.
Themes/DarkTheme/Style.css
css
CopyEdit
body {
background-color: #333;
color: white;
button {
background-color: #007BFF;
color: white;
padding: 10px;
border: none;
cursor: pointer;
A skin file defines styles for ASP.NET controls (e.g., buttons, textboxes).
Themes/DarkTheme/Controls.skin
asp
CopyEdit
No need to specify control IDs → The styles apply to all controls of that type.
Web.config
xml
CopyEdit
<configuration>
<system.web>
</system.web>
</configuration>
Now, all pages will automatically use the "DarkTheme".
If you want to apply a theme to only one page, set the Theme property in the Page directive.
Home.aspx
asp
CopyEdit
Easy Styling: Change the look of the entire website from one place.
Consistency: Ensures all pages have a uniform design.
Better Management: Separate design and logic, making updates easier.
User Choice: You can allow users to switch themes dynamically (e.g., Light Mode & Dark
Mode).
Conclusion
Themes in ASP.NET help developers apply consistent designs easily. By using CSS, Skin Files, and
Images, you can create different styles and apply them across your website with minimal effort.
A cookie is a small piece of data stored on the user's browser by a website. It helps websites
remember information about the user, such as login details, preferences, or shopping cart items.
Types of Cookies
1. Session Cookies
o Stored temporarily and deleted when the user closes the browser.
2. Persistent Cookies
o Example: Remembering a user's login so they don’t have to enter credentials every
time.
3. First-Party Cookies
4. Third-Party Cookies
o Created by other domains (like advertisers) to track users across multiple sites.
4. When the user revisits the website, the browser sends the cookie back to the website.
csharp
CopyEdit
myCookie.Value = "JohnDoe";
Response.Cookies.Add(myCookie);
csharp
CopyEdit
if (Request.Cookies["UserName"] != null)
CopyEdit
if (Request.Cookies["UserName"] != null)
Response.Cookies.Add(myCookie);
Advantages of Cookies
Disadvantages of Cookies
Conclusion
Cookies help websites remember users and provide a smoother experience. However, they should
be used carefully to protect privacy and security.
Session State is used to store data for a specific user during their visit (session) to a website. The
data is stored on the server and is unique to each user.
• Stores data per user (each user has their own session).
• Data exists only while the session is active (until the user closes the browser or times out).
• Typically used to store user-specific data like login information, shopping cart items, or
preferences.
<configuration>
<system.web>
</system.web>
</configuration>
Application State is used to store global data shared across all users of a website. The data is
stored on the server and remains available until the application stops (e.g., server restart).
Application["TotalVisitors"] = 100;
Key Differences:
Use User-specific data (e.g., login info, cart Site-wide data (e.g., visitor count,
Case items) settings)
Conclusion
• Use Session State when you need to store user-specific data for a limited time.
• Use Application State when you need to store global data that all users can access.
Here's a flowchart to visually explain Session State vs. Application State in ASP.NET:
Website Starts
ADO.NET (ActiveX Data Objects for .NET) is a data access technology in the .NET framework
that allows applications to connect to databases, execute queries, and fetch or update data.
It is used to interact with databases like SQL Server, MySQL, Oracle, and others.
Start
End
Establish Connection
conn.Open();
• Read Data:
while (reader.Read())
Console.WriteLine(reader["UserName"].ToString());
• Insert Data:
SqlCommand cmd = new SqlCommand("INSERT INTO Users (Name) VALUES ('John')", conn);
cmd.ExecuteNonQuery();
Close Connection
Conn.close( ) ;
The DataAdapter object in ADO.NET acts as a bridge between the database and the DataSet.
It is used to retrieve data from a database, store it in a DataSet, and update the database
with changes made in the DataSet.
Why Use a DataAdapter?
Start
End
Usage Best for modifying data Best for reading data quickly
Conclusion
DataSet Object
using System;
using System.Data;
using System.Data.SqlClient;
class Program
// Create DataAdapter
// Create DataSet
adapter.Fill(ds, "Users");
Console.WriteLine(row["UserName"]);
A DataTable is a single table stored in memory. It is a part of a DataSet but can also be used
independently.
using System;
using System.Data;
class Program
// Create a DataTable
// Define columns
dt.Columns.Add("UserID", typeof(int));
dt.Columns.Add("UserName", typeof(string));
dt.Rows.Add(1, "John");
dt.Rows.Add(2, "Jane");
Data Storage Stores relationships between tables Stores only rows and columns
Usage Used when handling multiple tables Used when handling a single table
Conclusion
Use DataSet when working with multiple tables (like an entire database in memory).
Use DataTable when working with a single table of data.
Both work in disconnected mode, meaning they fetch data from the database and store
it in memory.