M
Marc Lefebvre
Why I was unable to hide the previous button in the following code ?
private void ButtonClick(Object sender, System.EventArgs e)
{
Button button = (Button)sender;
Button previousButton = (Button)Session["previousButton"];
if( previousButton == null )
{
// keep the first button
previousButton = button;
Session["previousButton"] = previousButton;
}
else
{
// Hide both button
button.Visible = false;
previousButton.Visible = false; // E R R O R don't work
previousButton = null;
Session["previousButton"] = previousButton;
}
}
Thank's
Marc
private void ButtonClick(Object sender, System.EventArgs e)
{
Button button = (Button)sender;
Button previousButton = (Button)Session["previousButton"];
if( previousButton == null )
{
// keep the first button
previousButton = button;
Session["previousButton"] = previousButton;
}
else
{
// Hide both button
button.Visible = false;
previousButton.Visible = false; // E R R O R don't work
previousButton = null;
Session["previousButton"] = previousButton;
}
}
Thank's
Marc