Hi there,
Each loaded User Control maintains its own state. As you've seen, ViewState contains the (encoded) values that are set by .NET or by your own code. However, it doesn't directly write to the __ViewState hidden field but writes and reads through the
StateBag class. Internally, this class keeps track of which value belongs to which control instance. So, rather than storing with the following pseude code:
Banner.NavigateUrl = SomeValue
it does something like:
Parent + Banner.ID + NavigateUrl = SomeValue
This means the NavigateUrl can be stored in ViewState seperately for each Banner control you have somewhere in the Page hierarchy (e.g. in a master Page, a Page, a User Contro, and so on), even if they have the same ID (since they are located somewhere in the hierarchy, the "path" to them / their parent is unique.
Does this help?
Imar