To do that, you have to embrace the idea of
separation of concerns, or the idea of
orthogonality. There are Boolean expressions and condition. When you use them, it doesn't matter where did you get objects used in Boolean expressions and conditional statements. There are view states. When you write view state variables or read them, it doesn't matter how you use those variables. In other words,
separate and conquer.
Any
serializeable object can be uses as a view state variable. Working with view state variables is easy enough. Please see, for example:
http://asp.net-tutorials.com/state/viewstate[
^].
See also:
http://msdn.microsoft.com/en-us/library/z1hkazw7%28v=vs.100%29.aspx[
^].
And I trust you know how to write conditional (if, if-else) statements.
—SA