Session Variables?
Session Variables?
(B) Which various modes of storing ASP.NET session ? √ InProc:- In this mode
Session state is stored in the memory space of the Aspnet_wp.exe process.This
is the default setting.If the IIS reboots or web application restarts then session
state is lost.92 √ StateServer:-In this mode Session state is serialized and stored
in a separate process (Aspnet_state.exe); therefore, the state can be stored on
a separate computer(a state server). √ SQL SERVER:- In this mode Session state
is serialized and stored in a SQL Server database. Session state can be specified
in <sessionState> element of application configuration file.Using State Server
and SQL SERVER session state can be shared across web farms but note this
comes at speed cost as ASP.NET needs to serialize and deserialize data over
network again and again.
(A) What are the precautions you will take in order that StateServer Mode
work properly ?
(A) What are the precautions you will take in order that SQLSERVER
Mode work properly ?
(B) What are the other ways you can maintain state ?
Other than session variables you can use the following technique to
store state : √ Hidden fields √ View state √ Hidden frames √ Cookies
√ Query strings
Following are the benefits of using Hidden fields :- √ They are simple
to implement. √ As data is cached on client side they work with Web
Farms. √ All browsers support hidden field. √ No server resources
are required. Following are limitations of Hidden field :-94 √ They
can be tampered creating a security hole. √ Page performance
decreases if you store large data , as the data is stored in pages
itself. √ Hidden fields do not support rich structures as HTML hidden
fields are only single valued.Then you have to work around with
delimiters etc to handle complex structures. Below is how you will
actually implement hidden field in a project <input
id="HiddenValue" type="hidden" value="Initial Value"
runat="server"NAME="HiddenValue">
(B) What are benefits and Limitation of using Viewstate for state
management?
OOPS
They look very much same but are not same.Class is a definition ,
while object is a instance of the class created.Class is a blue print
while objects are actual objects existing in real world.Example we
have class CAR which has attributes and methods like
Speed,Brakes,Type of Car etc.Class CAR is just a prototype , now we
can create real time objects which can be used to provide
functionality . Example we can create a Maruti car object with 100
km speed and urgent brakes.
Abstraction
Encapsulation
The process of hiding all the internal details of an object from the
outside world.