I am currently reading a book about ASP.NET and I am a bit confused about one concept.
All the time I thought that no value can be saved over a postback if it is not either stored in viewstate, session state and so on. However, now I read about using Panels to have multi view content in one Page. I have the following code:
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
Panel1.Visible = true;
Panel2.Visible = false;
Panel3.Visible = false;
}
}
protected void GoNext_Click(object sender, EventArgs e)
{
if (Panel1.Visible)
{
Panel1.Visible = false;
Panel2.Visible = true;
}
else if (Panel2.Visible)
{
Panel2.Visible = false;
Panel3.Visible = true;
}
else if (Panel3.Visible)
{
Panel3.Visible = false;
Panel1.Visible = true;
}
}
Confusing part about that code is that, when I have Panel3 visible, for example, then how does ASP.NET know to also hide Panel1? (Because In the previous else if statement, I only tell ASP.NET to hide Panel2 and show Panel3, but I tell nothing about Panel1).
Are these values stored in ViewState?