Quote:
Are there any hard and fast rules in .NET for any of this when making these considerations?
|
No. You need to outweigh the pros and cons. If it's not directly clear, you'll need to measure performance and network trafic.
A complex number that takes 1 minute to calculate but only takes up the size of an integer is a good candidate to store in ViewState (if it doesn't have to be updated each time). A DataSet with 4000 records is clearly not a good candidate to store in ViewState. You could store it in the Cache, recreate it after each postback, or find ways to query fewer records on each call (but still not store them in ViewState).
Hope this helps a bit.
Imar