Unit 4
Unit 4
Unit 4
Web application,
Web forms,
Controls in web forms,
Events in Web form,
Form validations - Client side, Server side.
Q1. Write the two differences between windows application and web
application. Mca2022 2no.
Q2. What is the full form of MVC in ASP.NET?
Q1. Explain mouse mased events with example.
Q2. Write the differences between client side and server side.
Q1. Describe various controls in web forms.
ASP ASP.NET
1. Application Start
The webserver executes the application start when a user requests an application for access.
In this method, it sets all global variables to default.
2. Object Creation
Object creation holds all the HTTP Context, HTTP Request, and HTTP Response by the
webserver. It also contains information about the request, cookies, and browsing information.
3. HTTP Application
HTTP Application is an object created by the webserver. It helps to process all the
subsequent information that is sent to the user.
4. Dispose
Dispose is an event that is called before the application is destroyed. It also helps to release
manually unmanaged resources when the objects are no longer needed.
5. Application End
Application End is the last stage of the application life cycle. It helps to unload the memory.
The Page Life Cycle has certain phases that help in writing custom controls and initializing
an application.
Page Request is the first step of the page life cycle. When a user request is made, the server
checks the request and compiles the pages. Once the compilation is done, the request is sent
back to the user.
2. Page Start
Page Start helps in creating two objects: request and response. The request holds all the
information which the user sent, while the response contains all the information that is sent
back to the user.
3. Page Initialization
Page Initialization helps to set all the controls on the pages. It has a separate ID, and it applies
themes to the pages in this step.
4. Page Load
Page Load helps to load all the control properties of an application. It also helps to provide
information using view state and control state.
5. Validation
6. Event Handling
Event Handling takes place when the same pages are loaded. It is a response for the
validation.
7. Rendering
Rendering happens before it sends all the information back to the user.
8. Unload
Unload is a process that helps in deleting all unwanted information from the memory once
the output is sent to the user.
State Management maintains and stores the information of any user till the
end of the user session.
3. Profile Properties: This option also allows saving of user specific data.
4. Cache: it is used to implement page caching and data caching. A cache is primarily used to set
expiration policies.
3. Hidden Field: This field is used to store values on the client-side. The
hidden field works on request and is not displayed on the browser.
Web application: -
A web application is a type of computer program stored on a remote
server, accessible to users through a web browser.
It utilizes various web technologies to perform tasks over the internet.
A web application can be developed for several uses, which can be used by
anyone like it can be used as an individual or as a whole organization for
several reasons.
There is also some kind of web application that usually requires a special
kind of web browser to access them.
Web forms: -
Web Forms is a part of the ASP.NET framework that facilitates the creation
of dynamic web pages and web applications.
Web Forms are web pages that are requested by your users through their
browser.
HTML, client-script, server controls, and server code can all be used to
create these pages.
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.
HTML Controls
These controls render by the browser. We can also make HTML controls as server
control.
Controls Description
Name
2. Server Controls:
Server-side controls provided by ASP.NET, such as TextBox,
Button,DropDownList, GridView, etc.
Server Controls are more powerful and provide additional
features.
Example include:
TextBox: Input control for text.
Button: Triggering events on the server.
DropDownList: Selecting from a list of items.
GridView: Displays and allows editing of tabular data.
Calender: Allows users to select dates.
FileUpload: Enables file uploads from the client to the server.
Server Controls
Control Description
Name
Client side
Client-side form validation is performed on the user’s device (browser)
before the data is submitted to the server.
It enhances the user experience by providing immediate feedback.
JavaScript is commonly used for implementing client-side validations.
This approach improves responsiveness and makes the validation
process more user-friendly.
Client-side validation is convenient but should not be solely relied upon
for security.
Server side
Server-side validation is performed on the server after the form data is
submitted.
It is a crucial step to ensure data integrity and security.
It ensures that only valid and accepted data is processed on the server.
Server-side validation is essential because client-side validation can be
bypassed.
It provides more security for data.
Client-side Validation Server-side Validation
It does not provide security for data. It provides more security for data.
HTML, CSS, and javascript are used. PHP, Python, Java, Ruby are used.
It reduces load on processing unit of the It surge the processing load on the
server. server.