Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
21 views

Final Report of State Management Techniques in

Field project final report of state management technique

Uploaded by

riyagautam7887
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Final Report of State Management Techniques in

Field project final report of state management technique

Uploaded by

riyagautam7887
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Chapter First

1. Introduction and Scope of Project Work


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. The information
can be related to user, data objects, web pages or server objects. State management in any
application plays a vital role in preserving the states of users, web pages, objects, or controls. As
.NET developers know, HTTP is a stateless protocol, so all online ASP.NET web applications
are also stateless by default. That means the web application cannot preserve the state of control
for each page submitted to the server. In the modern era of web applications, there is a high
demand for state management.

1.1 Background, Literature Review


State management is a very important concept in software development. It refers to the way in
which an application manages and maintains the data or state of the application throughout its
lifecycle. State management in any application plays a vital role in preserving the states of users,
web pages, objects, or controls. As .NET developers know, HTTP is a stateless protocol, so all
online ASP.NET web applications are also stateless by default. That means the web application
cannot preserve the state of control for each page submitted to the server. In the modern era of
web applications, there is a high demand for state management. But what, exactly, is state
management, and how can it preserve the state of a web page or objects across page
submissions?
ASP.NET supports two types of state management approaches:
 Client-side State Management
 Server-side State Management

Client Side State Management


This maintains information on the client's machine using Cookies, View State, and Query
Strings.

1
HiddenField
A HiddenField is a control in ASP.NET that is used to hold values in the client browser. It can
store only one value for a variable and is used in situations where the value of a variable keeps
updating or gets updated regularly. It cannot be seen, as it is not rendered on the browser. On
every request made to the server, the HiddenField value is sent like any regular control value.

Cookies
A cookie is a small text file on the client machine either in the client's file system or memory of
client browser session. Cookies are not good for sensitive data. Moreover, Cookies can be
disabled on the browser. Thus, you can't rely on cookies for state management.

View State
Each page and each control on the page has View State property. This property allows automatic
retention of page and controls state between each trip to server. This means control value is
maintained between page postbacks. Viewstate is implemented using _VIEWSTATE, a hidden
form field which gets created automatically on each page. You can't transmit data to other page
using view state.

Control State
It is a technique used to maintain data work in order, properly. We use Control State to use the
view state without the possibility of it being disabled by the user.

QueryString
QueryString can maintain limited state information. Data can be passed from one page to another
with the URL but you can send limited size of data with the URL. Most browsers allow a limit of
255 characters on URL length.

Server Side State Management


This kind of mechanism retains state in the server.

Application State
The data stored in an application object can be shared by all the sessions of the application. The
application object stores data in the key value pair.

Session State
Session state stores session-specific information and the information is visible within the session
only. ASP.NET creates unique sessionId for each session of the application. SessionIDs are

2
maintained either by an HTTP cookie or a modified URL, as set in the application's
configuration settings. By default, SessionID values are stored in a cookie.

1.2 Project Work Plan, Relevance and Target Return


After gathering the requirements, you can start planning on the web application. In this step, the
web development first we will create a blueprint for the web application, including the user
interface, user experience, and system architecture. To perform State Management Techniques,
first we need plan for project work. The project plan in web application is the most critical part
of project management. This consists of a breakdown of the work to be done into phases, tasks
and other activities with estimates of time to complete the work. An effective project plan
involves the definition of scope and a feasibility study. After a successful plan is laid out, only
then can execution begin. State Management is the process by which the state and information of
a page can be maintained over multiple requests. ASP.NET provides several techniques to
maintain the information. The choice depends on the scope of the data and performance
considerations. One or more techniques can be used a single application depending on the needs.
Design any web form and place state management controls controls on a Web form.
There are various methods that are used for State Management. They are:
1. View State
2. Cookies
3. Query String
4. Hidden Field
5. Controls
6. Session State
7. Application State
All the preceding methods are used for State Management. View State, Cookies, Query String
are methods of Client-Side State Management whereas Session State and Application State are
methods of Server-Side State Management.

ASP.NET state management can be broadly divided into the following two categories:
1. Client-Side State Management
2. Server-Side State Management
Client Side State Management
In Client-Side State Management, the state of the page is maintained at the client side. The
following are the various techniques to do Client-Side State Management.
 View State
 Cookies
 Query String
 Hidden Field
 Controls
In Client-Side State Management, data is stored at the client side and sent to the browser every
time. This increases bandwidth usage. If the size of data is greater than the application will be
less responsive. Performance issues would occur.

3
Server Side State Management
In the Server-Side State Management, the state of the page is maintained at the server side. The
following are the various techniques to do Server-Side State Management:
 Application State (Variable)
 Session State (Variable)
Server-Side State Management provides better security. The state is saved on the server and
therefore isn't delivered to the client. The server side reduces the traffic to and from the client
because the data is not sent to the browser.
We will create a new ASP.NET Web Application that we can use as a starting point for our
application.
1. Start Visual Studio, on the File menu select New, and then select Project.
2. In the New Project dialog box, select Visual C# as the programming language.
3. In the Templates pane, select ASP.NET Empty Web Application, and name the
project StateManagement.
4. Click OK to create the solution and the project.
5. Add a Global Application Class file (Global.asax) to the project.
6. Add a new web form called Default to the project and rename it.
7. Add server side code if using client side state management techniques.
8. Add server side code if using server side state management techniques.
9. Design your web form and write the code according to state management techniques.
10. Build the Solution.

1.3 Concerned Workplace/Institution Details (where the work is done)


Name of Institution – Alina Softwares
Address –375, Mandakini Colony, Kolar Road, Bhopal
About Institute – Alina Softwares is one of the best training centre in Bhopal, Which provides
excellent computer training with 100% satisfaction of students. Alina Softwares provides
training on ASP.NET, Python, Java, PHP and other web Techonologies. Alina Softwares focuses
on practical-based training instead of theoretical knowledge. Many students have trained from
this institute and they all are doing job in reputed organizations.

4
Chapter Two

2. Project Methodology (Work Flow)


The workflow clearly outlines the various aspects of the development project and what needs to
be done at each stage. The workflow determines how you allocate your project time, resources,
and budget. It must be adaptable to your specific business and technical requirements. Web
applications are created by adding web forms to the application and placing controls to the forms
and respond to user interaction with the forms. The visual studio .NET is used to create a web
application. It is used to create different types of web application and web services provide
access to data. ASP.NET is a compiled programming environment that uses the .NET framework
to create an application. There are many approaches available for developing a web application
in .NET.

1. Setting up your Development Environment


To get started, you'll need to install Visual Studio, an integrated development environment (IDE)
provided by Microsoft. Visual Studio simplifies the development process and provides various
tools for building Asp.Net applications.

2. Creating a New Asp.Net Project


Once your development environment is set up, you can create a new Asp.Net project. Choose the
project type that best suits your needs, whether a web application, web API, or other web-related
project. Asp.Net offers a variety of project templates to start your development.

3. Designing your Web Application


Asp.Net allows you to design your application with a user-friendly interface. You can use
HTML, CSS, and JavaScript to create a visually appealing front end. This section will explore
the best practices for creating responsive and aesthetically pleasing web interfaces.

4. Implementing Server-Side Logic


Asp.Net enables you to develop server-side logic using C# or VB.NET. You can define your
business logic, manage data, and interact with databases seamlessly.

5. Testing and Debugging


It's crucial to thoroughly test and debug your web application to ensure it functions correctly.
Visual Studio provides powerful debugging tools to simplify this process.

6. Deployment
After testing, you can deploy your Asp.Net web application to a web server or hosting platform,
making it accessible to users worldwide.

5
2.1 Details of Information Collection / Field Survey
Information Collection is quite crucial in creating the best web applications. It involves
collecting info on a project’s objectives, features, and functionalities. This key step makes sure
the product meets the client’s needs and expectations. There are two categories of requirements,
first are User requirements and second is Business requirements. There are a number of different
techniques that can be used to gather and analyze requirements. Every project starts with data
requirement specification and data collection. Data collection is not an easy task. Sometimes it
takes long time to collect data. We collected data from different sources. Most of the data we
collected from online resources. It took lots of time and a lot of efforts. There are many methods
used for information or data collection in field project. Data collection techniques include
interviews, observations (direct and participant), face to face conversation, questionnaires, and
relevant documents. We have collected information from different website so that we make
effective web application.

2.2 Methods of Analysis/Applied Techniques


In an ideal case, users will enter valid data in a proper format in your application. But, as you All
ASP.NET web applications are stateless. By default, when a page posted to the server then the
state of controls is lost. So State management is used to preserve the state of a control, web page,
object/data, and user in the application explicitly. HTTP is a stateless protocol; actually,
statelessness is one of the many advantages of the WWW. In a statelessness condition, all
information associated with the page and the controls on the page would be lost with each
request from a user to Web Server and response from the Web server to a user. There is no
standard way in which the server can determine whether a subsequent HTTP request is from the
same user.
To overcome this limitation, ASP.NET includes several features that help you preserve data on
both sides (client side, server side) by its State Management Capabilities.
There are two types of state management techniques: client side and server side.

Client side
1. Hidden Field
2. View State
3. Cookies
4. Control State
5. Query Strings

Server side
1. Session
2. Application

6
2.3 Analysis of Information/Data
Once the data is collected, cleaned, and processed, it is ready for Analysis. As you manipulate
data, you may find you have the exact information you need, or you might need to collect more
data. Data analysis lets you see the present problems and prepare for and avoid future problems.
This ensures smooth project execution and timely project delivery. After analyzing the
requirements of the task to be performed, the next step is to analyze the problem and understand
its context. The first activity in the phase is studying the existing system and other is to
understand the requirements and domain of the new system. Both the activities are equally
important, but the first activity serves as a basis of giving the functional specification and then
successful design of the proposed system.
Analysis is the process of understanding the existing system by gathering and interpreting the
facts, diagnosing the problems. It is not just to determining the how best to solve the manual
system problems, it should also work for the system observes the feasibility of system then
design, coding phases will be executed.

7
Chapter Three

3. Conclusions, Results Obtained and Analysis


In the modern era of web applications, there is a high demand for state management.
State management is the technique of maintaining the state of an application over time, i.e., for
the duration of a user session or across all of the HTTP requests and responses that constitute
the session. It was great experience to work together in a team. It showed us how much important
the project co-ordination is? Standards that are need to maintain and significance of conventions
followed in the project which always helps to remove the coding error efficiently and easily. After
doing project on State Management Techniques in ASP.NET, we can conclude that this project is
efficient enough for learning and provides great helps in increasing the knowledge. Thus it is one of
the most important cross-cutting concerns of any web application. Following are the screenshot
of developed web applications by the group members:

Client Side State Management using View State

8
Client Side State Management using Control State

Client Side State Management using Hidden Field

9
Client Side State Management using Persistent Cookie

Client Side State Management using Non Persistent Cookie

10
Client Side State Management using Query String

11
Server Side State Management using Session

Server Side State Management using Application

12
Server Side State Management using Application (Display in other Browser)

3.1 Challenges in Project Work


To build a successful web application, several factors contribute to its success, including cost,
design, and value for money. Maintaining a .NET web application can present a variety of
challenges, including performance issues. During web app development, developers often
encounter various challenges. Here are some common challenges faced during web app
development:
1. Performance Optimization: Ensuring the web application performs well and loads
quickly is crucial. Developers need to optimize code, reduce server request to enhance
performance.
2. Cross-Browser Compatibility: Web applications should work consistently across
different web browsers (Chrome, Firefox, Safari, etc.). However, each browser has its
quirks and varying levels of support for web technologies, which can lead to
compatibility issues.

13
3. Responsive Design: With the increasing use of mobile devices, web applications need to
be responsive and provide an optimal user experience across various screen sizes.
Designing and implementing responsive layouts can be challenging.
4. Security: Web applications face potential security risks, including cross-site scripting,
SQL injection and more. Developers need to implement robust security measures, such
as input validation, encryption, secure authentication, and authorization mechanisms.
5. Scalability: As user demand grows, web applications must handle increasing traffic and
data loads. Designing and building a scalable architecture that can handle high volumes
of users and transactions are a significant challenge.
6. Testing and Debugging: Thorough testing and debugging are essential to identify and
fix issues. However, web app testing can be challenging due to browser compatibility,
different devices, network variations, and complex user interactions.
7. Accessibility: Web applications should be accessible to users with disabilities. Ensuring
compliance with accessibility standards (e.g., WCAG) and providing a seamless
experience for users with impairments can pose challenges.
8. Maintenance and Updates: After deployment, web apps require regular maintenance,
updates, bug fixes, and feature enhancements. Ensuring smooth updates without
disrupting user experience or introducing new issues can be a challenge.
These challenges can vary depending on the complexity of the web application, the
technologies used, and the project requirements. Skilled developers and thorough planning
can help overcome these challenges effectively.

3.2 Recommendations Based on Conclusion


In conclusion, effective state management is crucial for creating successful web applications
with ASP.NET as it helps to ensure that data is stored safely and securely. All modern web
applications have a high demand for state management, programmers must know about various
strategies of state management. With the growing emphasis on real-time and interactive user
experiences, state management will likely continue to evolve to meet the demands of modern
web development. As ASP.NET accepts new technologies, state management will remain a
critical component for the development of robust and responsive web applications. In future we
will develop some real life application using state management techniques.

14
Reference List

Books:

• Sams Teach Yourself ASP.NET 4- Scott Mitchell


• ASP.NET Bible - Mridula Parihar
• Programming Microsoft ASP.NET 4 – Dino Esposito
• ASP.NET The complete Reference - Matthew MacDonald
• ASP.NET 3.5: A beginners Guide – William Sanders
• Microsoft ASP.NET 4 Step-By-Step – George Shepherd

Websites Reference:
• https://dotnet.microsoft.com/en-us/learn/aspnet
• https://www.javatpoint.com/asp-net-tutorial
• https://www.guru99.com/asp-net-tutorial.html
• https://asp.net-tutorials.com/
• https://www.tutorialspoint.com/asp.net/index.htm
• https://www.simplilearn.com/tutorials/asp-dot-net-tutorial
• https://www.pragimtech.com/courses/asp-net-tutorial-for-beginners/
• https://www.dotnettricks.com/learn/aspnet

15

You might also like