On Aug 14, 12:08 pm, "antonyliu2...@yahoo.com"
<antonyliu2...@yahoo.comwrote:
My web form has a MultiView which has 4 Views. 4 LinkButtons on the
web form activates each of the 4 views.
The 4 views have been hiding and showing nicely depending upon which
LinkButton is clicked.
But, when I try to get the ActiveViewIndex when the [Submit] button is
clicked, I always get 0. Or if I do
Multiview1.GetActiveView().ID;
I always get the name of the first view.
What is wrong? I googled, but haven't found anyone experiencing this
problem yet.
Again, it is because of the postback ghost.
In Page_Load, I did
MutiView1.ActiveViewIndex = 0;
Wrapping it up with
if (!Page.IsPostBack)
{
// That ghost line here.
}
Solves the problem.
Question: Does a page ALWAYS post back to itself when any button is
clicked? On my web form I attempt to redirect to another page
through:
Response.Redirect("AnotherPage.aspx");
when the [Submit] button is clicked.
It looks like that the web form is posted back to itself, such that if
you don't do
if (!Page.IsPostBack)
, the ActiveViewIndex will again be set to 0. Right?