Difference between viewstate, cache, session

Answers were Sorted based on User's Feedback



Difference between viewstate, cache, session..

Answer / chinmayee mishra

SESSION: Variables are stored on the server, can hold any
type of data including references, they are similar to
global variables in a windows application and use HTTP
cookies to store a key with which to locate user's session
variables.

VIEWSTATE: Variables are stored in the browser (not as
cookies) but in a hidden field in the browser. Also
Viewstate can hold only string data or serializable objects.


CACHE: It refers to information that is reused in your
application, or information that is stored on your computer
so it can be reused. For example, if you download an image
from the internet, it's often cached so you can view it
again without downloading the image data. Caching is a form
of replication in which information learned during a
previous transaction is used to process later transactions.

To make web surfing faster, web browsers store recently
visited pages on the user’s disk. When the site is
revisited, the browser displays pages from the cache
instead of requesting them from the server. Reloading
brings up the current page from the server.

Is This Answer Correct ?    11 Yes 0 No

Difference between viewstate, cache, session..

Answer / govindarao konduri

view state:- This is common way to store the data in view state.View state is using 'hidden files' to store data.Advantage is performance.Disadvantage is if any cross post back occurs the view state will expires.

Caching:- The caching always store the resulted data.First time user send a request to server, the user required data will be stored in caching from the server.Next time onwards no need to go for server,we can get the information from the caching..

Session:- Session is very secure because it was located at server.Sessions are (2) types.
1.inproc
2.Out-process(its preferred)
*State server
*Sql server

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More ASP.NET Interview Questions

Explain what is an assembly?

0 Answers  


Advantage of Update Panel over Asp.net 2.0 + C#+ Microsoft Ajax 1.0

1 Answers   InfoSpace,


What does the following SQL statement return, assuming that all tables and column names are correct? SELECT FirstName, StreetAddress FROM Employees JOIN AddressBook ON Employees.EmpID = AddressBook.EmpID a) Nothing, the JOIN syntax is wrong. b) All the records form the Employees table, and only the matching ones form the StreetAddress table. c) All the records from the StreetAddress table and only the matching records form the Employees table. d) Only the matching records from the two tables.

4 Answers   Syntax Softtech,


What event fired during, when datagrid click?

1 Answers  


You have been given the task of designing a web services to expose the data that is stored in a database on the server. In order to successfully build the web services, you need to import some namespaces. What is the minimum namespace you need to import? a) System.Web b) System.WebServices c) System.Web.Services d) System.Web.ServiceModel

2 Answers   Syntax Softtech,


What is a nested masterpage in asp.net 2.0? Can there be a master page inside a masterpage?

0 Answers  


How many webforms are possible on a single webpage?

6 Answers  


What is localization and Globalization?

3 Answers  


Explain the concept of event bubbling in ASP.NET?

0 Answers   Sans Pareil IT Services,


List some of the important session state modes of asp.net.

0 Answers  


Is asp.net core faster?

0 Answers  


Am not able to move the controls on the form freely in asp.net 3.5 even though I selected the position as relative or absolute for those controls. What should I do to overcome this?

0 Answers  


Categories