Final Report of State Management Techniques in
Final Report of State Management Techniques in
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.
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.
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.
4
Chapter Two
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.
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
8
Client Side State Management using Control State
9
Client Side State Management using Persistent Cookie
10
Client Side State Management using Query String
11
Server Side State Management using Session
12
Server Side State Management using Application (Display in other Browser)
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.
14
Reference List
Books:
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