KEMBAR78
Unit 05 | PDF | World Wide Web | Internet & Web
0% found this document useful (0 votes)
12 views23 pages

Unit 05

ASP.NET is a web development platform by Microsoft that enables the creation of robust web applications for both PCs and mobile devices, utilizing various programming languages such as C# and Visual Basic.Net. It includes components like Common Language Runtime (CLR), .Net Framework Class Library, and Windows Forms for building interactive applications, along with ASP.NET Web Forms, MVC, and Web Pages for web development. The document also outlines the differences between Windows Forms and Web Forms, detailing their deployment, user interface, state management, and security features.

Uploaded by

Vishal Bhardwaj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views23 pages

Unit 05

ASP.NET is a web development platform by Microsoft that enables the creation of robust web applications for both PCs and mobile devices, utilizing various programming languages such as C# and Visual Basic.Net. It includes components like Common Language Runtime (CLR), .Net Framework Class Library, and Windows Forms for building interactive applications, along with ASP.NET Web Forms, MVC, and Web Pages for web development. The document also outlines the differences between Windows Forms and Web Forms, detailing their deployment, user interface, state management, and security features.

Uploaded by

Vishal Bhardwaj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Unit 05

Introduction to ASP.NET
ASP.NET is a web development platform, which provides a programming model, a
comprehensive software infrastructure and various services required to build up robust web
applications for PC as well as mobile devices.
ASP.NET works on top of the HTTP protocol, and uses the HTTP commands and
policies to set a browser-to-server bilateral communication and cooperation.
ASP.NET is a part of Microsoft .Net platform. ASP.NET applications are compiled codes, written
using the extensible and reusable components or objects present in
.Net framework. These codes can use the entire hierarchy of classes in .Net
framework.
ASP.NET application codes can be written in any of the following languages:
 C#
 Visual Basic.Net
 Jscript
 J#
ASP.NET is used to produce interactive, data-driven web applications over the internet. It consists
of a large number of controls such as text boxes, buttons, and labels for assembling, configuring,
and manipulating code to create HTML pages.
Components and their Description
(1) Common Language Runtime or CLR
It performs memory management, exception handling, debugging, security checking, thread
execution, code execution, code safety, verification, and compilation. The code that is directly
managed by the CLR is called the managed code. When the managed code is compiled, the
compiler converts the source code into a CPU independent intermediate language (IL) code. A
Just-In-Time (JIT) compiler compiles the IL code into native code, which is CPU specific.

(2) .Net Framework Class Library


It contains a huge library of reusable types, classes, interfaces, structures, and enumerated values,
which are collectively called types.
(3) Common Language Specification
It contains the specifications for the .Net supported languages and implementation of language
integration.
(4) Common Type System
It provides guidelines for declaring, using, and managing types at runtime, and cross-language
communication.
(5) Metadata and Assemblies
Metadata is the binary information describing the program, which is either stored in a portable
executable file (PE) or in the memory. Assembly is a logical unit consisting of the assembly
manifest, type metadata, IL code, and a set of resources like image files.
(6) Windows Forms
Windows forms contain the graphical representation of any window displayed in the application.
(7) ADO.NET
It is the technology used for working with data and databases. It provides access to data sources
like SQL server, OLE DB, XML etc. The ADO.NET allows connection to data sources for
retrieving, manipulating, and updating data.

(8) Windows Workflow Foundation (WF)


It helps in building workflow-based applications in Windows. It contains activities, workflow
runtime, workflow designer, and a rules engine.
(9) Windows Presentation Foundation
It provides a separation between the user interface and the business logic. It helps in developing
visually stunning interfaces using documents, media, two and three dimensional graphics,
animations, and more.

(10) Windows Communication Foundation (WCF)


It is the technology used for building and executing connected systems.
(11) Windows CardSpace
It provides safety for accessing resources and sharing personal information on the internet.
(12) LINQ
It imparts data querying capabilities to .Net languages using a syntax which is similar to the
tradition query language SQL.

Introduction to C# Windows Forms Applications:


Windows Forms is a Graphical User Interface(GUI) class library which is bundled in .Net
Framework. Its main purpose is to provide an easier interface to develop the applications for
desktop, tablet, PCs. It is also termed as the WinForms. The applications which are developed by
using Windows Forms or WinForms are known as the Windows Forms Applications that runs on
the desktop computer. WinForms can be used only to develop the Windows Forms Applications
not web applications. WinForms applications can contain the different type of controls like labels,
list boxes, tooltip etc.

1. Editor Window or Main Window: Here, you will work with forms and code editing. You
can notice the layout of form which is now blank. You will double click the form then it
will open the code for that.
2. Solution Explorer Window: It is used to navigate between all items in solution. For
example, if you will select a file form this window then particular information will be
display in the property window.
3. Properties Window: This window is used to change the different properties of the selected
item in the Solution Explorer. Also, you can change the properties of components or
controls that you will add to the forms.
Now to add the controls to your WinForms application go to Toolbox tab present in the
extreme left side of Visual Studio. Here, you can see a list of controls. To access the most
commonly used controls go to Common Controls present in Toolbox tab.

Now drag and drop the controls that you needed on created Form. For example, if you can
add TextBox, ListBox, Button etc. as shown below. By clicking on the particular dropped
control you can see and change its properties present in the right most corner of Visual
Studio.
C# Windows Forms is a graphical user interface (GUI) framework that enables developers to
create desktop applications for the Windows operating system. Windows Forms applications
are created using the C# programming language and the .NET framework. They are built by
dragging and dropping controls such as buttons, text boxes, labels, and other user interface
elements onto a form.
1. The Windows Forms framework provides a rich set of controls that developers can use to
build applications with. These controls are designed to provide a consistent and familiar
user interface for Windows users. Developers can customize the appearance and behavior
of these controls by setting various properties and handling events.
2. To create a Windows Forms application in C#, you can use Microsoft Visual Studio, which
is an integrated development environment (IDE) that provides a visual designer to create
and layout the user interface elements. The visual designer is a drag-and-drop interface for
building your UI, and you can easily configure each control’s properties through a user-
friendly interface.
3. In addition to the visual designer, Visual Studio also provides a code editor that enables
developers to write the C# code for the application’s logic. Developers can handle events
and perform tasks such as data validation, data manipulation, and business logic
implementation.
4. Windows Forms applications are versatile and can be used to create various types of
applications such as data entry, management, and reporting applications, as well as games
and multimedia applications.
Resizing Menus:
In Windows Forms applications, resizing menus typically involves adjusting the layout of your
controls dynamically as the form size changes.
Anchor and Dock Properties: Ensure that your menu controls (like MenuStrip) and other controls
on the form are anchored or docked properly. This allows them to resize and reposition themselves
automatically when the form is resized.
Handling Form Resize Event: You can handle the Resize event of the form to adjust the size and
position of your menu controls accordingly. Here's a simple example in C#:
private void Form1_Resize(object sender, EventArgs e)
{
// Adjust the menu control position
menuStrip1.Width = this.Width;

// Optionally, adjust other controls based on the form size


// control1.Width = this.Width - someOffset;
// control1.Height = this.Height - someOffset;
}

Relative Sizing: Instead of setting absolute sizes for controls, you can use relative sizing
techniques. For example, you can set the menu width as a percentage of the form width, ensuring
that it scales appropriately.
Handling Menu Items: If you have dynamic menu items or menus, you may need to adjust their
size and position programmatically in response to the form's resize event.
Testing: After implementing the resizing logic, thoroughly test your application by resizing the
form to different sizes to ensure that the menu and other controls adjust correctly.
private void Form1_Resize(object sender, EventArgs e)
{
menuStrip1.Width = this.Width;
}

This code assumes that the Menu Strip control (named menuStrip1) is docked at the top of the
form and that you want it to resize horizontally with the form.
Differences between Windows Forms and Web Forms:
Technology:
Windows Forms: Windows Forms applications are designed to run on a local machine's operating
system (Windows). They provide a rich user interface that interacts directly with the user's
machine.
Web Forms: Web Forms applications are designed to run on a web server and are accessed through
a web browser. They use HTML, CSS, and JavaScript to render the user interface on the client-
side.

Deployment:
Windows Forms: Windows Forms applications are deployed as standalone executables that need
to be installed on each user's machine.
Web Forms: Web Forms applications are deployed on a web server and accessed through a browser
without the need for installation on user machines.

User Interface:
Windows Forms: Windows Forms provide a rich, desktop-like user interface with controls tailored
for desktop applications.
Web Forms: Web Forms provide a web-based user interface that works within the limitations of
web browsers and web technologies.

State Management:
Windows Forms: Windows Forms applications can store state on the local machine, such as in
registry settings or local files.
Web Forms: Web Forms applications need to manage state on the server-side or through client-
side mechanisms like cookies, session variables, or hidden fields.

Security:
Windows Forms: Windows Forms applications have access to the local file system and resources,
which can raise security concerns if not properly managed.
Web Forms: Web Forms applications run in a sandboxed environment within the browser, limiting
access to the user's system for security reasons.

Connectivity:
Windows Forms: Windows Forms applications can connect directly to local resources and
databases without the need for internet connectivity.
Web Forms: Web Forms applications need an internet connection to communicate with a web
server and access remote resources.

Cross-Platform Compatibility:
Windows Forms: Windows Forms applications are limited to Windows-based operating systems
and do not have native support for cross-platform deployment.
Web Forms: Web Forms applications can be accessed on any device with a web browser, making
them more cross-platform compatible.

Common controls:
1. Label: Displays text that the user cannot edit.
2. TextBox: Allows users to input text.
3. Button: Triggers an action when clicked.
4. DropDownList: Presents a list of options for users to select from.
5. CheckBox: Represents a single checkbox for users to toggle.
6. RadioButton: Allows users to select a single option from a group.
7. GridView: Displays tabular data with options for sorting, paging, and editing.
8. ListView: Similar to the GridView but offers more flexibility in design.
9. Repeater: A basic control for repeating a template at runtime.
10. FileUpload: Enables users to upload files to the server.
11. Image: Displays an image on the web page.
12. HyperLink: Renders a hyperlink that users can click to navigate to another page.
13. Calendar: Provides a calendar for date selection.
14. Validator Controls (e.g., RequiredFieldValidator, RegularExpressionValidator):
Validates user input based on specified criteria.
15. DropDownMenu: Displays a hierarchical menu of items for navigation.

These controls help you build interactive and user-friendly web applications in ASP.NET Web
Forms. They provide a wide range of functionality, from basic text input to complex data
presentation and validation mechanisms.

ASP.NET:
It is a web framework designed and developed by Microsoft. It is used to develop websites,
web applications and web services. It provides fantastic integration of HTML, CSS and
JavaScript. It was first released in January 2002. It is built on the Common Language Runtime
(CLR) and allows programmers to write code using any supported .NET language.
ASP.NET provides three development styles for creating web applications:
1. Web Forms
2. ASP.NET MVC
3. ASP.NET Web Pages

Web Forms
It is an event driven development framework. It is used to develop application with powerful
data access. It provides server side controls and events to create web application. It is part of
the ASP.NET framework. We will discuss it further in next chapters.

ASP.NET MVC
It gives us a MVC (Model View Controller), patterns-based way to build dynamic websites. It
enables a clean separation of concerns and that gives you full control over markup for
enjoyable, agile development. It also provides many features that enable fast development for
creating outstanding applications. We will discuss it further in next chapters.

ASP.NET Web Pages


It is used to create dynamic web pages. It provides fast and lightweight way to combine server
code with HTML. It helps to add video, link to the social sites. It also provides other features
like you can create beautiful sites that conform to the latest web standards.
All these are stable and well equipped frameworks. We can create web applications with any
of them. These are also based on the .NET Framework and share core functionalities of .NET
and ASP.NET.
ASP.NET Page Lifecycle:

In ASP.NET, a web page has execution lifecycle that includes various phases. These phases
include initialization, instantiation, restoring and maintaining state etc. it is required to
understand the page lifecycle so that we can put custom code at any stage to perform our
business logic.

 Page Request: When the user requests a page, the server checks the request and then
compiles the page.
 Page Start: In this phase, the two steps are carried out first is "request" and second
is"response". The request holds all information from the page.
 Page Initialization: In this phase, all the controls on the page are set, and each has a
particular ID, and themes are applied to the pages.
 Page Load: In Page Load, all the control properties are loaded, and information is set using
view state and control state.
 Validation: The validation happens when the page execution goes successful it returns
true else the execution fails it returns false.
 Event Handling: This happens in response to validation. In this case, the page is loaded
again. So, the postback event handler is called.
 Rendering: It occurs before all the response information is sent to the user. It also stores
all the information sent to the user.
 Unload: This phase helps to clean all the unwanted information. And it also cleans the
memory once the page output is sent to the user.

Page Life Cycle Stages:

 PreInit: It is the first event in the page life cycle. And it checks the IsPostBack property
and determines whether the page is a postback. It sets the themes and master pages, creates
dynamic controls, and gets and sets profile property values. The PreInit event can be
handled by overloading the OnPreInit method.
 Init: This event is used to initialize the control property and the control tree is built. The
Init event can be handled by overloading the OnInit method or creating a Page_Init handler.
 InitComplete: This event allows tracking of the view state. And it controls turn-on view-
state tracking. The InitComplete event can be used to make changes in ViewState.
 PreLoad: This event is raised when the page loads the ViewState. And it Loads the
PostBack data.
 Load: The page's load event is raised first, followed by recursively raising all child
controls' load events. The control tree's controls are made. The OnLoad method can be
overloaded to handle this event, or a Page Load handler can be made.
 Control Events: It is used to handle specific control events such as Button control' Click
event.
 LoadComplete: LoadComplete event occurs at the end of the event-handling stage. We
can use this event for tasks that require all other controls on the page to be loaded.
 PreRender: This event takes place just before the output is rendered. By handling this
event, pages, and controls can perform any updates before the output is rendered. This
event occurs after the page object has created all controls that are required in order to render
the page.
 PreRenderComplete: This event is triggered recursively for all child controls, make sure
that the pre-rendering phase is completely done. This event happens once each data-bound
control with its DataSourceID property set calls the DataBind method.
 SaveStateComplete: The SaveStateComplete is raised after the view state and the control
state have been saved for the page and for all controls.
 Render: This is not an event; rather, the Page object calls this method on each control at
this step of processing.
 Unload: This is the last event and it is raised for each control and then for the page. It can
be handled by modifying the On UnLoad method.
ASP.NET Web Forms:

Web Forms are web pages built on the ASP.NET Technology. It executes on the server and
generates output to the browser. It is compatible to any browser to any language supported by
.NET common language runtime. It is flexible and allows us to create and add custom controls.

We can use Visual Studio to create ASP.NET Web Forms. It is an IDE (Integrated Development
Environment) that allows us to drag and drop server controls to the web forms. It also allows us to
set properties, events and methods for the controls. To write business logic, we can choose any
.NET language like: Visual Basic or Visual C#.

Web Forms are made up of two components: the visual portion (the ASPX file), and the code
behind the form, which resides in a separate class file.

ASP.NET provides various controls like: server controls and HTML controls for the Web
Forms.
HTML Controls:
These controls render by the browser.

ASP.NET Web Forms Features:


o Server Controls
o Master Pages
o Working with data
o Membership
o Client Script and Client Frameworks
o Routing
o State Management
o Security
o Performance
o Error Handling
Server Controls
Web Forms provides rich set of server controls. These controls are objects that run when the page
is requested and render markup to the browser. Some Web server controls are similar to familiar
HTML elements, such as buttons and text boxes. It also provides controls that we can use to
connect to data sources and display data.

Master Pages
It allowsus to create a consistent layout for the pages in our application. This page defines the look
and feel and standard behavior that we want for all of the pages in our application. When users
request the content pages, they merge with the master page to produce output that combines the
layout of the master page with the content from the content page.

Working with Data


In an ASP.NET Web Forms application, we use data-bound controls to automate the presentation
or input of data in web page UI elements such as tables and text boxes and drop-down lists.

Membership
Project's Account folder contains the files that implement the various parts of membership:
registering, logging in, changing a password, and authorizing access. Additionally, ASP.NET Web
Forms supports OAuth and OpenID. These authentication enhancements allow users to log into
your site using existing credentials, from such accounts as Facebook, Twitter and Google.

Client Script and Client Frameworks


We can enhance the server-based features of ASP.NET by including client-script functionality in
ASP.NET Web Form pages. We can use client script to provide a richer, more responsive user
interface to the users. We can also use client script to make asynchronous calls to the Web server
while a page is running in the browser.

Routing
We can configure URL routing of our application. A request URL is simply the URL a user enters
into their browser to find a page on our web site. We use routing to define URLs that are
semantically meaningful to users and that can help with search-engine optimization (SEO).

State Management
ASP.NET Web Forms includes several options that help you preserve data on both a per-page
basis and an application-wide basis.

Security
Developing a secure application is most important aspect of software development process.
ASP.NET Web Forms allow us to add extensibility points and configuration options that enable
us to customize various security behaviors in the application.

Performance
Web Forms provides good performance and allows us to modify performance related to page and
server control processing, state management, data access, application configuration and loading,
and efficient coding practices.
Difference between asp.net controls and html controls:

The main difference between ASP.NET controls and HTML controls lies in how they are created
and rendered in a web application:

ASP.NET Controls:
Server-side Controls:
ASP.NET controls are server-side controls that are created and manipulated on the server.
They provide a higher level of abstraction and are easier to work with in the code-behind file.

Event-Driven Model:
ASP.NET controls have built-in event-handling mechanisms that make it easy to respond to user
interactions, such as button clicks.
Events are handled on the server-side, simplifying interaction with the control.

ViewState Support:
ASP.NET controls automatically maintain their state across postbacks using ViewState.
This allows for easier management of control states and data preservation.

Rich Functionality:
ASP.NET controls come with rich functionality out of the box, such as validation controls, data
binding controls, and user interface controls like GridView and Repeater.

HTML Controls:
Client-side Controls:
HTML controls are client-side controls that are rendered directly in HTML markup.
They are lightweight and do not provide the same level of functionality and ease of interaction as
ASP.NET controls.

Limited Functionality:
HTML controls are basic input elements like <input> , <button> , <select> , and <textarea> .
They typically do not have built-in event-handling mechanisms or advanced features like data
binding.

Direct Markup:
HTML controls are directly represented in HTML markup and are manipulated using client-side
JavaScript or other client-side technologies.
They require more manual coding compared to ASP.NET controls.

No View State:
HTML controls do not have built-in mechanisms for maintaining state across postbacks like
ASP.NET controls.
State management needs to be handled manually using techniques like hidden fields or client-side
storage.
ASP.NET State Management:
State Management is a process by which state and page information is maintained over multiple
requests for same or different pages. As HTTP is a stateless protocol, server does not store any
information once the
response is sent back to client based on his request. When user submits request again, the server
treats it as a new user. This is called stateless model. This model was workable when static web
sites were developed and hosted in the past. Now, with interactive web sites or dynamic web site,
there is a need to preserve some information to identify user, interact with user again and again
within same session and same application. This concept is known as Stateful protocol. The
information can be related to user, data objects, web pages or server objects.

Server Side State Management Options

ASP.NET provides facility to save information on server side as well as in client side. The
following options are available in Server Side State Management.
o Application State: Application state allows saving of data at application level which is
accessible throughout the life of an application. The life of application starts when IIS is
started and ends when IIS is stopped.
o Session State: The session state persists till the user is active or session time expires. When
a user submits request, a session is started. The session gets over either when time expires
or user explicitly abandons the sessions. The required information can be saved in session
for later user by same user within the same application.
o Profile Properties: This option also allows saving of user specific data. It is similar to
Session state except the data stored in Profile state never expires on use this property, the
SQLProfileProvider class needs to be configured. It allows storing of data in SQL database.
Since data is stored in database and not in application memory, therefore there is no risk of
losing data even if IIS is restarted again and again.
o Cache: Caching is a technique by which frequently used data and web pages are stored in
cache so that repeated cost of retrieval can be avoided. Storing frequently used data in
cache ensures high availability, improved performance and scalability. Cache is object of
System.Web Caching Cache class. The main disadvantage of using Cache is that it is
unreliable. The previously stored data stored in cache is deleted automatically to meet
memory requirement of current process.
Client Side State Management Options
The options available in client side state management help in storing information either in the page
or at the client computer. No information is stored at server side. The followings options are used
for client side state management.
o View State: View state provides facility to preserve page and values of controls at the
client side. The information is stored after post back. Post back is a request from user for
the page which is not for the first time. If value of IsPostBack property is true, it means
page is not requested for the first time. The view state can be at page level, application
level, machine level and control level. In page level state management, as long as the user
is on current page, the information is retained. Whenever user submits form, the current
state of page and controls are hashed into a string and saved in hidden field of the page.
More than one hidden field can be used if data exceed limit set
by MaxPageStateFieldLength property. When page is sent to server, the page parses the
view state string and restores the information. This is default mechanism. The view state
can be disabled at any stage. The property EnableViewState="false" is used in code when
it is required to disable view state
The demonstrate the concept of view state option, consider an ASP.NET project haring one ben
Each time a button is clicked, it displays the number of times the button is clicked.
o Control State: This is another client side state management option. This is used when
there is a need to store control data related to Custom control. View state can be disabled
but control state cannot be disabled.
o Hidden Field State: ASP.NET allows storing information in a hidden field which is a
server control and can be used to store information at page level. The value of the hidden
field is sent to HTTP form collection along with value of other controls. The hidden file
can be created in source file as given below.<input type="hidden" id="username"
name="username" value=""
This hidden field can be accessed in code behind file as given below. Dim st as String = Request
QueryString("username")
o Cookies: Cookie is a small amount of information that is stored in client machine.
o QueryString: A QueryString contains the information that is sent to server with URL.

Master Page In ASP.NET:


Master page allows you to create a consistent look and behavior for all the pages in your web
applications. Master Page Design is common for all the pages. Master page actually consists of
two pieces, the master page itself and one or more content pages. A master page is an ASP.NET
file with the extension .master. Content Placeholder control, which defines a region on the master
page, is where the content pages can plug in page specific content.
Advantages of using Master Page in ASP.NET:
Master pages enable consistent and standardized layout of the website.

- You can make layout changes of the site in the master page instead of making changes in the
pages.

- It is very easy to implement.

- It provides an object model which allows you to customize the master page from individual
content pages.
- It allows you to centralize the common functionality of your pages so that you can make
updates in just one place.

A Master page offers a template for one or more web forms.

- It defines placeholders for the content, which can be overridden by the content pages.

- The content pages contain only content.

- When users request the content page, ASP.NET merges the layout of the master page with the
content of the content page and produce output.

Advantage and disadvantage of asp.net:


Advantages:
1. Rapid Development: ASP.NET facilitates rapid development of web applications due to
its built-in features, controls, and libraries. Developers can utilize tools like Visual Studio
to streamline the development process.

2. Scalability: ASP.NET applications can easily scale to accommodate increased user loads
and data volume. It provides features like caching, session state management, and
application pooling to optimize performance.

3. Security: ASP.NET offers robust security features such as authentication, authorization,


and encryption. Developers can implement security measures to protect against common
web vulnerabilities like SQL injection and cross-site scripting (XSS).

4. Language Support: ASP.NET supports multiple programming languages, including C#,


VB.NET, and F#, allowing developers to choose the language that best suits their project
requirements and expertise.

5. Integration with Microsoft Technologies: ASP.NET seamlessly integrates with other


Microsoft technologies such as Azure cloud services, SQL Server databases, and Active
Directory, enabling developers to build comprehensive solutions within the Microsoft
ecosystem.

Disadvantages:

Platform Dependency: ASP.NET applications are primarily designed to run on Windows servers,
which may limit deployment options for developers who prefer other platforms like Linux or
macOS.

Cost: While ASP.NET itself is free and open-source, developers may incur costs associated with
licensing fees for development tools like Visual Studio and server hosting fees for Windows
servers.
Steep Learning Curve: ASP.NET has a steep learning curve, especially for beginners with limited
experience in web development or Microsoft technologies. Developers may require time and
resources to acquire proficiency in ASP.NET development.

Vendor Lock-In: Since ASP.NET is a Microsoft product, developers may face vendor lock-in,
making it challenging to migrate to alternative platforms or technologies in the future.

Performance Overhead: While ASP.NET offers excellent performance and scalability, it may
introduce some performance overhead compared to lightweight frameworks or languages like
Node.js or PHP, especially for simple or static content.

Web server scripting and Client server scripting-


The scripts may be created in two ways: on the client side or the server side, where the server-side
scripts are processed on a server. In contrast, client-side scripting needs browsers to execute scripts
on the client system but doesn't connect with the server executing the client-side scripts.

Server-side scripting is a programming technique for creating code that may run software on the
server side. In other words, server-side scripting is any scripting method that may operate on a web
server. At the server end, actions such as website customization, dynamic changes in website
content, response creation to user requests, database access, and many more are carried out.

Server-side scripting creates a communication channel between a server and a client.


Previously, CGI (Common Gateway Interface) scripts were used to implement server-side
scripting, and CGI was created to execute scripts written in computer languages such as C++ or
Perl on websites.

The server-side is made up of three parts: the database, the server, the APIs, and the backend web
software written in the server-side scripting language. When a browser requests a page with server-
side scripting, the web server evaluates the script before delivering the page to the browser. In this
case, script processing may entail collecting information from a database, performing simple
computations, or selecting the relevant material to be shown on the client end. The output is
provided to the web browser when the script is processed. The web server hides the scripts from
the end user until the content is delivered, making the data and source code safer.

Server-side scripting languages-


Python
PHP

Client-side scripting generates code that may be executed on the client end without needing
server-side processing. These scripts are typically embedded into HTML text. Client-side scripting
may be utilized to check the user's form for problems before submitting it and to change the content
based on the user input. The web needs three components to function: client, database, and server.

The client-side scripting may significantly reduce server demand. It is intended to be utilized as a
scripting language with a web browser as the host program. The HTML and CSS are delivered as
plain text when a user uses a browser to request a webpage from the server, and the browser
understands and renders the web content at the client end.

Client-side Scripting Languages-


HTML
CSS
JAVASCRIPT
VBSCRIPT

Head-to-head comparison between Server-side Scripting and Client-side Scripting:

You might also like