what is the use of viewstate [Resolved]

Posted by Saisindura under ASP.NET on 2/8/2012 | Points: 10 | Views : 1429 | Status : [Member] | Replies : 6
1.what is the use of view state.

2.in which condition view state is using.

3.what is the difference between cache and session.

4.in which condition cache is used.

5.in which condition session is used.

Thanks&Regards
srisai



Responses

Posted by: Blessyjees on: 2/8/2012 [Member] Bronze | Points: 50

Up
0
Down

Resolved
hi,

Refer these links

http://www.codeproject.com/Articles/31994/Beginners-Introduction-to-State-Management-Techniq#need
http://www.codeproject.com/Articles/31344/Beginner-s-Guide-To-View-State

Blessy Baby
Digitalmesh Softech pvt Ltd
https://blessybaby.wordpress.com/

Saisindura, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Swapnil on: 2/8/2012 [Member] Starter | Points: 50

Up
0
Down

Resolved
1.what is the use of view state.

Ans. : Viewstate is used to maintain state of object (values of control, variable etc...)..

2.in which condition view state is using.
Ans.: Mainly, Viewstate is used when want to maintain state / values of the control / object / variable across postbacks (e.g. page submission / page refresh due to some control event).

3.what is the difference between cache and session.
Ans : There are many difference but main difference is usage, Cache is used Application wide while Session is used when you want to maintain session (user specific) level data.

4.in which condition cache is used.
Ans: When you have repetitive data across the application like Static Images or some static data. Cache lifetime is first time hitting that object / application start and it will end when application ends / on predefined cache expiration time.

5.in which condition session is used.
Ans: When you want to maintain user specific details (like user id and name etc...). Session lifetime is opening of site in user browser and It will ends when user close the browser / site.

Thanks and Regards,
Swapnil

Saisindura, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Saisindura on: 2/8/2012 [Member] Starter | Points: 25

Up
0
Down
hello sir

can you give me real time example ,in which condition view state is used.


Thanks&Regards
srisai

Saisindura, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 2/8/2012 [Member] Silver | Points: 25

Up
0
Down
Hi,
For example you can go through following link once.
http://msdn.microsoft.com/en-us/library/ms972976.aspx

Thanks,
Sanjay

Saisindura, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 2/8/2012 [Member] Silver | Points: 25

Up
0
Down
Look at another example here
http://asp-net-example.blogspot.in/2009/01/aspnet-viewstate-example-how-to-use.html

Thanks,
Sanjay

Saisindura, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajkatie on: 7/3/2012 [Member] [MVP] Gold | Points: 25

Up
0
Down
Q 3:
refer following link
http://forums.asp.net/t/1696160.aspx/1

Rajesh Patel
.Net Trainer(MSCD | MCT | MS)
Brainbench (Asp.Net 4.5 and C# 5.0)

Saisindura, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response