2

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

Canavar
  • 47,715
  • 17
  • 91
  • 122
Vijjendra
  • 24,223
  • 12
  • 60
  • 92
  • Duplicate http://stackoverflow.com/questions/233828/does-viewstate-expire (not exact but close enough) – James Oct 15 '09 at 20:54

3 Answers3

2

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
  • 67,283
  • 14
  • 105
  • 142
0

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
  • 47,715
  • 17
  • 91
  • 122
0

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
  • 2,143
  • 19
  • 44