-1

I have two panels, one below the other. The 1st panel is visible and the 2nd panel is not visible. When user presses a button, I need the 1st panel to disappear, to be replaced by the 2nd panel.

But when the 1st panel becomes invisible and 2nd becomes visible, the page has a big gap where the 1st panel was.

Here is how I hide the first panel:

Protected Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
    START_SECTION_PANEL.Visible = False
    CONTACT_INFO_PANEL.Visible = True
End Sub

I tried display none but it still shows the spaces:

    Protected Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
    START_SECTION_PANEL.Visible = False
    START_SECTION_PANEL.Style.Add("display", "none")

    CONTACT_INFO_PANEL.Visible = True

End Sub
pixelmeow
  • 657
  • 1
  • 11
  • 30
Doug Null
  • 7,556
  • 14
  • 58
  • 132

1 Answers1

0

Actually,

Panel1.Visible = false;

Should do the trick. Check if you have some styles like margin for 2nd panel.

Or you can add styles like:

display: none;

and change CssClass onclick

Artem
  • 1,767
  • 1
  • 11
  • 19