Annddrew:So why in the Polls chapter only the PollID property of the PollBox user control is saved to the ControlSate. Why not save the other properties as well such as ShowArchiveLink and ShowHeader etc... ? Thanks
Because the PollID is the only property which actually needs to be stored by the PollBox user control. The other properties refer to "real" server controls inside the user control. The value of these server controls are already stored in Viewstate. For example, look at ShowArchiveLink
public bool ShowArchiveLink
{
get { return lnkArchive.Visible; }
set { lnkArchive.Visible = value; }
}
The value of the ShowArchiveLink property is gotten from the value of lnkArchive.Visible. The properties of lnkArchive are already stored in Viewstate.
PollID, on the other hand, is not connected to any of the server controls, and thus cannot be retrieved from Viewstate.
// ******************************if (this.PostHelpedYou)
{
MarkAsAnswer();
}