Viewstate is bound to controls that support it so no it doesn't apply to variables.
Viewstate is a tricky thing actually and a very double edged sword. If you use viewstate on any of the list controls they persist the entire list contents which can be huge if you have a lot of data. Yet it's the only way to automatically maintain say a selection in a list box through the Web Control interface.
From what I've seen so far I've been very leary of ViewState, especially since text controls will automatically retain their data content without viewstate which is probably the main feature that is of interest in the Web Form's metaphor.
+++ Rick ---
>>Bob,
>>
>>Since the context of discussion here is state of a
variable, let me clarify your comments about state of
controls:
>>
>
>Right... so my understanding was you can only use it with controls, and you have to use session state for variables. Or, are you saying you CAN use viewstate to maintain the state of variables too?
>
>BOb