Search This Blog

Thursday, July 23, 2015

Web Development Fundamentals:- Understand ASP.NET Intrinsic Objects

Understand State Information in Web Applications

State management Control?
ASP.NET provides state management facility at four levels:
application, session, page, and request.

ASP.NET helps with state management control by maintaining
state and page information over multiple requests for the same or different pages.

Application state is a data repository available to all classes in
an ASP.NET application. Application state is stored in memory on the server
and is faster than storing and retrieving information in a database.

Control state persists control information that must be retained between
 postbacks, even if view state is disabled for the page or for a control.
Control state is stored in one or more hidden fields.
This can include information such as items added to a shopping cart

Session state enables you to store and retrieve values for a user as the user
navigates ASP.NET pages in a Web application.


View state is used to preserve page and control values between client and server.
 It provides state information. Note: this only provides state information
for a specific ASP.NET page.

Types can be stored in view state?

Data is stored in hidden fields and can contain: 
— Strings
— Integers
— Boolean values
— Array objects
— ArrayList objects
— Hash tables
— Custom type converters

Cookies:-
A cookie is a small bit of text that accompanies requests and pages as they go
between the Web server and browser. The cookie contains information
 the Web application can read whenever the user visits the site.
Cookies will persist beyond the current session, which allows
 the application to save information for future sessions.
Cookies are convenient because they prevent the user from having to
retype information on subsequent visits. However,
there are privacy issues surrounding their use.

Lesson Review:-
Discuss situations where you would use each state and why.
One of the most used forms of state is session state. Why?
When are cookies used? Why are they used?





@adsbygoogle