views:

92

answers:

3

Hi All, I want to know is there any way to expire the viewstate after a particuler given time.

+2  A: 

Have you tried using Session instead. It will be better security than placing an expiration date into the ViewState which can be modified by the user. Sessions have a default expiration of 20 minutes, but you can modify that.

Yuriy Faktorovich
A: 

No, there isn't an expiration feature of the viewstate. But maybe you can set a datetime value to an viewstate variable that you'll check later for your own expiration logic.

Canavar
The ViewState can be modified by the user.
Yuriy Faktorovich
A: 

It sounds as if you need to use cookies (not exactly like viewstate but can hold data too). You can force cookies to expire or set an expiration date but you cannot do the same view state.

Phil