Professional Documents
Culture Documents
ASP.NET
• It is used to maintain the state of the user across multiple
pages.
{ OR }
Web server maintaining client information with out any
connectivity is called as state management .This can be
implemented in various ways
1.View State [ Hidden field ]
2. Page Submission
3.Cookies
4.Session
5.Query String
6.Application
7. Cache
View State
• It is the concept of persisting controls
properties between requests under post back
implementation.
• The view state will be implemented based
on hidden field.
Points to remember about view state
• The main advantage of view state will be 2 things
• There is no programming required from the developer so less
burden on the developer.
• The memory will not be allocated in the client system nor at
in the webserver system.It will be maintained as the part of
the web page itself.
• The problem with a view state is there will be more amount
of data transfer between client and web server.
• The view state can be controlled at the 3 levels
1 } Control Level
<Input = ….Enable viewstate=“true/false”>
Note : when it comes to sensitive data it is not
recommended to implement view state the sensitive data can
be password,credit card no, etc.
Points to remember about view state
• When you go with password type textbox the view state
will not be applicable implicitly.
• 2} Page Level
<%@ Pagedirective …..enable viewstate=“true/false” >
• 3 }Application Level
It requires web config
It will be applicable to all the web pages
COOKIES
• It is used to maintain the server side information at the client
system. { OR } A cookie can be defined as a small amount of
memory used by the web server on the client system.
Usage : The main purpose of cookies will be storing perosonal
information of the client,it can be username,pwd,no of
visits,session id.
• Cookies can be of 2 types:-
• Client Side Cookies If the cookie information is set using
Javascript / VbScript within an HTML page then it is said to be a
client Side Cookies.
• Server Side CookiesIf the cookie information is set using server
side technology then it is said to be server side cookies.They are of
2 types:
1] Persistant Cookies ( Permanent Cookies )
2] nonPersistant Cookies ( Temporary Cookies )
• 1] Persistant Cookies ( Permanent Cookies )
– When the cookie is stored on to the hard disk
memory then it is called as persistant cookie.
– When you provide expires than the cookie will
be considered as persistent.