Make panels visible and invisible.

  • Thread starter Thread starter Miguel Dias Moura
  • Start date Start date
M

Miguel Dias Moura

Hello,

i have 5 panels in an ASP.net / VB page.
The panel 1 is visible the other 4 are NOT visible.

I also have 5 images: image 1, image 2, ..., image5.

When i click one of the images, image N, the panel N becomes visible and
all the other invisible.

Can you tell me how shoudl the script be and how should be the image code
be?

Thank You,
Miguel
 
Hi Miguel.

You multipost in a lot of groups and does not follow up your previous
messages, do you want to be so kind to crosspost next time, than we can see
what where the answers in the other groups.

crossposting sending one message to more newsgroups with a comma to seperate
them.

Thanks,

Cor
 
Hi Miguel,

I assume that where as well the other questions,

Here a sample how to do what you ask.

I hope this helps?

Cor
\\\
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
viewstate.Item("T") = 1
End If
Dim frm As Control = Me.FindControl("Form1")
Dim ctl As Control
For Each ctl In frm.Controls
If TypeOf ctl Is Panel Then
DirectCast(ctl, Panel).Visible = False
End If
Next
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Select Case viewstate.Item("T")
Case 1
Panel1.Visible = True
Case 2
Panel2.Visible = True
Case 3
Panel3.Visible = True
Case 4
Panel4.Visible = True
Case 5
Panel5.Visible = True
viewstate.Item("T") = 0
End Select
viewstate.Item("T") = CInt(viewstate.Item("T")) + 1
End Sub
///
 
Hi Cor,

i allways have problems in making things work when this Handles... is used.
Have no idea why.

I have been looking at ASP.net scripts for a month. I know i am just
starting but everytime someone helps me out and sends me some code like this
i end up hitting my head in the walls :-)

Could you send me a simple ASP.net file with 2 panels, 2 images and this
code, so i can check how is this implemented.
If you can send it to me please use my email but take the NoSpam from the
address.

Thank You,
Miguel
 
Hi Miguel,

Most people in this vb.language newsgroup are using Visual Studio Net and
with that they got compiled programs. However it can as well with scripting,
I did not do this for a while, however try this one.

You can paste it in an empty sample1.aspx

I hope it helps?

Cor

<HTML>
<HEAD>
<title>Sample1</title>
<script language="VB" runat="server">
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
If Not IsPostBack Then
viewstate.Item("T") = 1
End If
Dim frm As Control = Me.FindControl("Form1")
Dim ctl As Control
For Each ctl In frm.Controls
If TypeOf ctl Is Panel Then
DirectCast(ctl, Panel).Visible = False
End If
Next
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
Select Case viewstate.Item("T")
Case 1
Panel1.Visible = True
Case 2
Panel2.Visible = True
Case 3
Panel3.Visible = True
Case 4
Panel4.Visible = True
Case 5
Panel5.Visible = True
viewstate.Item("T") = 0
End Select
viewstate.Item("T") = CInt(viewstate.Item("T")) + 1
End Sub
</script>
</HEAD>
<body MS_POSITIONING="GridLayout">
<TABLE height="533" cellSpacing="0" cellPadding="0" width="490" border="0"
ms_2d_layout="TRUE">
<TR vAlign="top">
<TD width="490" height="533">
<form id="Form1" method="post" runat="server">
<TABLE height="473" cellSpacing="0" cellPadding="0" width="521" border="0"
ms_2d_layout="TRUE">
<TR vAlign="top">
<TD width="360" height="96"></TD>
<TD width="48"></TD>
<TD width="113"></TD>
</TR>
<TR vAlign="top">
<TD colSpan="2" height="32"></TD>
<TD>
<asp:Button text="Button" OnClick="Button1_Click" runat="server"
ID="Button1"></asp:Button></TD>
</TR>
<TR vAlign="top">
<TD height="72"></TD>
<TD colSpan="2">
<asp:Panel id="Panel1" runat="server" Width="160px" Height="48px"
BorderStyle="Double">Panel
<asp:Label id="Label1" runat="server"
Width="64px">1</asp:Label></asp:Panel></TD>
</TR>
<TR vAlign="top">
<TD height="72"></TD>
<TD colSpan="2">
<asp:Panel id="Panel2" runat="server" Width="160px" Height="48px"
BorderStyle="Dotted">Panel
<asp:Label id="Label2" runat="server">2</asp:Label></asp:Panel></TD>
</TR>
<TR vAlign="top">
<TD height="72"></TD>
<TD colSpan="2">
<asp:Panel id="Panel3" runat="server" Width="160px" Height="56px"
BorderStyle="Ridge">Panel
<asp:Label id="Label3" runat="server">3</asp:Label></asp:Panel></TD>
</TR>
<TR vAlign="top">
<TD height="72"></TD>
<TD colSpan="2">
<asp:Panel id="Panel4" runat="server" Width="160px" Height="56px"
BorderStyle="Outset">Panel
<asp:Label id="Label4" runat="server">4</asp:Label></asp:Panel></TD>
</TR>
<TR vAlign="top">
<TD height="57"></TD>
<TD colSpan="2">
<asp:Panel id="Panel5" runat="server" Width="160px" Height="56px"
BorderStyle="Solid">Panel
<asp:Label id="Label5" runat="server">5</asp:Label></asp:Panel></TD>
</TR>
</TABLE>
</form>
</TD>
</TR>
</TABLE>
</body>
 
Hi,

i tryied it but it doesn't work. I tryied to make some changes but nothing
happens.

Miguel
 
Hi Cor,

i have a script i have been using which changes from one panel to the next
or previous one using "Previous" and "Next" buttons.
Can you help me in changing this code to change the panels using the 5
images as buttons as i described before...

Maybe it's a better idea.

Thank You,
Miguel

Here is the code:

<script runat="Server">

Sub Page_Load
If Not IsPostBack Then
ViewState( "CurrentPage" ) = 1
End If
End Sub

Sub btnNextPage_Click( s As Object, e As EventArgs )
Dim pnlPanel As Panel
Dim strPanelName AS String

' Hide Previous Panel
strPanelName = "panelSubscribe" & ViewState( "CurrentPage" )
pnlPanel = FindControl( strPanelName )
pnlPanel.Visible = False

' Show Current Panel
ViewState( "CurrentPage" ) += 1
strPanelName = "panelSubscribe" & ViewState( "CurrentPage" )
pnlPanel = FindControl( strPanelName )
pnlPanel.Visible = True

End Sub

Sub btnPrevPage_Click( s As Object, e As EventArgs )
Dim pnlPanel As Panel
Dim strPanelName AS String

' Hide Current Panel
strPanelName = "panelSubscribe" & ViewState( "CurrentPage" )
pnlPanel = FindControl( strPanelName )
pnlPanel.Visible = False

' Show Previous Panel
ViewState( "CurrentPage" ) -= 1
strPanelName = "panelSubscribe" & ViewState( "CurrentPage" )
pnlPanel = FindControl( strPanelName )
pnlPanel.Visible = True

End Sub

Sub btnFinish_Click( s As Object, e As EventArgs )End Sub

</script>
 
Hi Cor,

you are right, it's working...i did a mistake when i pasted the code.

However it's not working as i need to make it work.
It has a button and when i click the button the next panel becomes visible
and the previous one becomes invisible.

However, what i want to to have 5 buttons. Each one associated to a panel.
When i press button1, panel1 becomes visible and the one that was visible
becomes invisible, see?

I was looking at you code and trying to changing to make it this happen but
until now i wasn't able to do it.

Can you give me some tips?

Thank You,
Miguel
 
you are right, it's working...i did a mistake when i pasted the code.
However it's not working as i need to make it work.
It has a button and when i click the button the next panel becomes visible
and the previous one becomes invisible.

However, what i want to to have 5 buttons. Each one associated to a panel.
When i press button1, panel1 becomes visible and the one that was visible
becomes invisible, see?

That is even simpler, I did not test it, I change it here in the code
bellow. So watch typos, the buttons are as well not so nice alligned, they
would be probably side by side.

I hope this helps?

Cor


<HTML>
<HEAD>
<title>Sample1</title>
<script language="VB" runat="server">
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
If Not IsPostBack Then
viewstate.Item("T") = 1
End If
Dim frm As Control = Me.FindControl("Form1")
Dim ctl As Control
For Each ctl In frm.Controls
If TypeOf ctl Is Panel Then
DirectCast(ctl, Panel).Visible = False
End If
Next
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
Panel1.Visible = True
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
Panel2.Visible = True
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
Panel3.Visible = True
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
Panel4.Visible = True
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
Panel5.Visible = True
End Sub
</script>
</HEAD>
<body MS_POSITIONING="GridLayout">
<TABLE height="533" cellSpacing="0" cellPadding="0" width="490" border="0"
ms_2d_layout="TRUE">
<TR vAlign="top">
<TD width="490" height="533">
<form id="Form1" method="post" runat="server">
<TABLE height="473" cellSpacing="0" cellPadding="0" width="521" border="0"
ms_2d_layout="TRUE">
<TR vAlign="top">
<TD width="360" height="96"></TD>
<TD width="48"></TD>
<TD width="113"></TD>
</TR>
<TR vAlign="top">
<TD colSpan="2" height="32"></TD>
<TD>
<asp:Button text="Button1" OnClick="Button1_Click" runat="server"
ID="Button1"></asp:Button>
<asp:Button text="Button2" OnClick="Button2_Click" runat="server"
ID="Button1"></asp:Button>
<asp:Button text="Button3" OnClick="Button3_Click" runat="server"
ID="Button1"></asp:Button>
<asp:Button text="Button4" OnClick="Button4_Click" runat="server"
ID="Button1"></asp:Button>
<asp:Button text="Button5" OnClick="Button5_Click" runat="server"
ID="Button1"></asp:Button>
</TD>
</TR>
<TR vAlign="top">
<TD height="72"></TD>
<TD colSpan="2">
<asp:Panel id="Panel1" runat="server" Width="160px" Height="48px"
BorderStyle="Double">Panel
<asp:Label id="Label1" runat="server"
Width="64px">1</asp:Label></asp:Panel></TD>
</TR>
<TR vAlign="top">
<TD height="72"></TD>
<TD colSpan="2">
<asp:Panel id="Panel2" runat="server" Width="160px" Height="48px"
BorderStyle="Dotted">Panel
<asp:Label id="Label2" runat="server">2</asp:Label></asp:Panel></TD>
</TR>
<TR vAlign="top">
<TD height="72"></TD>
<TD colSpan="2">
<asp:Panel id="Panel3" runat="server" Width="160px" Height="56px"
BorderStyle="Ridge">Panel
<asp:Label id="Label3" runat="server">3</asp:Label></asp:Panel></TD>
</TR>
<TR vAlign="top">
<TD height="72"></TD>
<TD colSpan="2">
<asp:Panel id="Panel4" runat="server" Width="160px" Height="56px"
BorderStyle="Outset">Panel
<asp:Label id="Label4" runat="server">4</asp:Label></asp:Panel></TD>
</TR>
<TR vAlign="top">
<TD height="57"></TD>
<TD colSpan="2">
<asp:Panel id="Panel5" runat="server" Width="160px" Height="56px"
BorderStyle="Solid">Panel
<asp:Label id="Label5" runat="server">5</asp:Label></asp:Panel></TD>
</TR>
</TABLE>
</form>
</TD>
</TR>
</TABLE>
</body>
</HTML>
 
Hi,

thanks for that image information. That's what i was looking for.
About the code you are sending me i am getting an error:

Line 6: <script language="VB" runat="server">
Line 7:
Line 8: Private Sub Page_Load(ByVal sender As System.Object, _ByVal e As
System.EventArgs)
Line 9:
Line 10: If Not IsPostBack Then

* These are the first lines in the script as displayed after.

I only made a correction to the code as the ID's of the buttons were all the
same. I didn't change anything in the script:

<script language="VB" runat="server">

Private Sub Page_Load(ByVal sender As System.Object, _ByVal e As
System.EventArgs)

If Not IsPostBack Then
viewstate.Item("T") = 1
End If

Dim frm As Control = Me.FindControl("Form1")
Dim ctl As Control

For Each ctl In frm.Controls
If TypeOf ctl Is Panel Then
DirectCast(ctl, Panel).Visible = False
End If
Next

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, _ByVal e As
System.EventArgs)

Panel1.Visible = True

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, _ByVal e As
System.EventArgs)

Panel2.Visible = True

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, _ByVal e As
System.EventArgs)

Panel3.Visible = True

End Sub

Private Sub Button4_Click(ByVal sender As System.Object, _ByVal e As
System.EventArgs)

Panel4.Visible = True

End Sub

Private Sub Button5_Click(ByVal sender As System.Object, _ByVal e As
System.EventArgs)

Panel5.Visible = True

End Sub

</script>
 
Hi Miquel,

thanks for that image information. That's what i was looking for.
About the code you are sending me i am getting an error:
That row that you gives an error on 6 is with me on row 4, the buttons
where not nice alligned however after doing that and I tested it, did work
again as I expected.

<HTML>
<HEAD>
<title>Sample1</title>
<script language="VB" runat="server">
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
If Not IsPostBack Then
viewstate.Item("T") = 1
End If
Dim frm As Control = Me.FindControl("Form1")
Dim ctl As Control
For Each ctl In frm.Controls
If TypeOf ctl Is Panel Then
DirectCast(ctl, Panel).Visible = False
End If
Next
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
Panel1.Visible = True
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
Panel2.Visible = True
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
Panel3.Visible = True
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
Panel4.Visible = True
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
Panel5.Visible = True
End Sub
</script>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:Button text="Button1" OnClick="Button1_Click" runat="server"
ID="Button1" style="LEFT: 232px; POSITION: absolute; TOP:
48px"></asp:Button>
<asp:Button text="Button2" OnClick="Button2_Click" runat="server"
ID="Button2" style="LEFT: 304px; POSITION: absolute; TOP:
48px"></asp:Button>
<asp:Button text="Button3" OnClick="Button3_Click" runat="server"
ID="Button3" style="LEFT: 376px; POSITION: absolute; TOP:
48px"></asp:Button>
<asp:Button text="Button4" OnClick="Button4_Click" runat="server"
ID="Button4" style="LEFT: 448px; POSITION: absolute; TOP:
48px"></asp:Button>
<asp:Button text="Button5" OnClick="Button5_Click" runat="server"
ID="Button5" style="LEFT: 528px; POSITION: absolute; TOP:
48px"></asp:Button>
<asp:Panel id="Panel1" runat="server" Width="160px" Height="48px"
BorderStyle="Double" style="LEFT: 360px; POSITION: absolute; TOP:
128px">Panel
<asp:Label id="Label1" runat="server" Width="64px">1</asp:Label></asp:Panel>
<asp:Panel id="Panel2" runat="server" Width="160px" Height="48px"
BorderStyle="Dotted" style="LEFT: 360px; POSITION: absolute; TOP:
200px">Panel
<asp:Label id="Label2" runat="server">2</asp:Label></asp:Panel>
<asp:Panel id="Panel3" runat="server" Width="160px" Height="56px"
BorderStyle="Ridge" style="LEFT: 360px; POSITION: absolute; TOP:
272px">Panel
<asp:Label id="Label3" runat="server">3</asp:Label></asp:Panel>
<asp:Panel id="Panel4" runat="server" Width="160px" Height="56px"
BorderStyle="Outset" style="LEFT: 360px; POSITION: absolute; TOP:
344px">Panel
<asp:Label id="Label4" runat="server">4</asp:Label></asp:Panel>
<asp:Panel id="Panel5" runat="server" Width="160px" Height="56px"
BorderStyle="Solid" style="LEFT: 360px; POSITION: absolute; TOP:
416px">Panel
<asp:Label id="Label5" runat="server">5</asp:Label></asp:Panel>
</form>
</body>
</HTML>
 
Hi,

it's working fine now. Maybe there is something wrong going on with the way
i am creating the files in Dreamweaver.
Anyway, now everything is working very well.

Thank You Very Much for your help and patiente,
Miguel
 
Hello Cor,

one more problem: i just created the page as i want to work with the code
you sent me and the image buttons as the page in Microsoft.

When i run it i don't get any error but no panel or button is visible.
The reason why i have several sets of buttons is because in each panel there
is an image which is not a button but only an image with the different color
which i call image-hit.gif, indicating in which section the person is.

Can you check what am i doing wrong here? See the page code in the botton
please.

Thank

My entire page code is:

<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1"
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<script language="VB" runat="server">

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs)

If Not IsPostBack Then
viewstate.Item("T") = 1
End If

Dim frm As Control = Me.FindControl("formDados")
Dim ctl As Control

For Each ctl In frm.Controls
If TypeOf ctl Is Panel Then
DirectCast(ctl, Panel).Visible = False
End If
Next

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.Web.UI.ImageClickEventArgs)

panelDados1.Visible = True

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.Web.UI.ImageClickEventArgs)

panelDados2.Visible = True

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.Web.UI.ImageClickEventArgs)

panelDados3.Visible = True

End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.Web.UI.ImageClickEventArgs)

panelDados4.Visible = True

End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As
System.Web.UI.ImageClickEventArgs)

panelDados5.Visible = True

End Sub

</script>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<link href="css/bonsAlunosStyles.css" rel="stylesheet" type="text/css">
</head>
<body>
<form id="formDados" method="post" runat="server">
<asp:Panel ID="panelDados1" Runat="Server">
<table width="468" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="11" align="center" class="greyNoteText"></td>
<td width="457" align="left" class="greyNoteText">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="image/button-ensino-hit.gif" width="49"
height="18"></td>
<td><asp:ImageButton ID="button2Panel1"
AlternateText="Curriculum Vitae"
ImageUrl="image/button-curriculum-vitae.gif" ToolTip="Curriculum Vitae"
OnClick="Button2_Click" runat="server" /></td>
<td><asp:ImageButton ID="button3Panel1"
AlternateText="Localização" ImageUrl="image/button-localizacao.gif"
ToolTip="Localização" OnClick="Button3_Click" runat="server" /></td>
<td><asp:ImageButton ID="button4Panel1"
AlternateText="Documentos Publicados"
ImageUrl="image/button-documentos-publicados.gif" ToolTip="Documentos
Publicados" OnClick="Button4_Click" runat="server" /></td>
<td><asp:ImageButton ID="button5Panel1"
AlternateText="Contacte-me" ImageUrl="image/button-contacte-me.gif"
ToolTip="Contacte-me" OnClick="Button5_Click" runat="server" /></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Panel 01</td>
</tr>
</table>
</td>
</tr>
</table>
</asp:Panel>
<asp:Panel ID="panelDados2" Runat="Server">
<table width="468" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="11" align="center" class="greyNoteText"></td>
<td width="457" align="left" class="greyNoteText">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><asp:ImageButton ID="button1Panel2"
AlternateText="Ensino" ImageUrl="image/button-ensino.gif" ToolTip="Ensino"
OnClick="Button1_Click" runat="server" /></td>
<td><img src="image/button-curriculum-vitae-hit.gif"
width="105" height="18"></td>
<td><asp:ImageButton ID="button3Panel2"
AlternateText="Localização" ImageUrl="image/button-localizacao.gif"
ToolTip="Localização" OnClick="Button3_Click" runat="server" /></td>
<td><asp:ImageButton ID="button4Panel2"
AlternateText="Documentos Publicados"
ImageUrl="image/button-documentos-publicados.gif" ToolTip="Documentos
Publicados" OnClick="Button4_Click" runat="server" /></td>
<td><asp:ImageButton ID="button5Panel2"
AlternateText="Contacte-me" ImageUrl="image/button-contacte-me.gif"
ToolTip="Contacte-me" OnClick="Button5_Click" runat="server" /></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Panel 02</td>
</tr>
</table>
</td>
</tr>
</table>
</asp:Panel>
<asp:Panel ID="panelDados3" Runat="Server">
<table width="468" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="11" align="center" class="greyNoteText"></td>
<td width="457" align="left" class="greyNoteText">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><asp:ImageButton ID="button1Panel3"
AlternateText="Ensino" ImageUrl="image/button-ensino.gif" ToolTip="Ensino"
OnClick="Button1_Click" runat="server" /></td>
<td><asp:ImageButton ID="button2Panel3"
AlternateText="Curriculum Vitae"
ImageUrl="image/button-curriculum-vitae.gif" ToolTip="Curriculum Vitae"
OnClick="Button2_Click" runat="server" /></td>
<td><img src="image/button-localizacao-hit.gif" width="76"
height="18"></td>
<td><asp:ImageButton ID="button4Panel3"
AlternateText="Documentos Publicados"
ImageUrl="image/button-documentos-publicados.gif" ToolTip="Documentos
Publicados" OnClick="Button4_Click" runat="server" /></td>
<td><asp:ImageButton ID="button5Panel3"
AlternateText="Contacte-me" ImageUrl="image/button-contacte-me.gif"
ToolTip="Contacte-me" OnClick="Button5_Click" runat="server" /></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Panel 03</td>
</tr>
</table>
</td>
</tr>
</table>
</asp:Panel>
<asp:Panel ID="panelDados4" Runat="Server">
<table width="468" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="11" align="center" class="greyNoteText"></td>
<td width="457" align="left" class="greyNoteText">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><asp:ImageButton ID="button1Panel4"
AlternateText="Ensino" ImageUrl="image/button-ensino.gif" ToolTip="Ensino"
OnClick="Button1_Click" runat="server" /></td>
<td><asp:ImageButton ID="button2Panel4"
AlternateText="Curriculum Vitae"
ImageUrl="image/button-curriculum-vitae.gif" ToolTip="Curriculum Vitae"
OnClick="Button2_Click" runat="server" /></td>
<td><asp:ImageButton ID="button3Panel4"
AlternateText="Localização" ImageUrl="image/button-localizacao.gif"
ToolTip="Localização" OnClick="Button3_Click" runat="server" /></td>
<td><img src="image/button-documentos-publicados-hit.gif"
width="145" height="18"></td>
<td><asp:ImageButton ID="button5Panel4"
AlternateText="Contacte-me" ImageUrl="image/button-contacte-me.gif"
ToolTip="Contacte-me" OnClick="Button5_Click" runat="server" /></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Panel 04</td>
</tr>
</table>
</td>
</tr>
</table>
</asp:Panel>
<asp:Panel ID="panelDados5" Runat="Server">
<table width="468" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="11" align="center" class="greyNoteText"></td>
<td width="457" align="left" class="greyNoteText">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><asp:ImageButton ID="button1Panel5"
AlternateText="Ensino" ImageUrl="image/button-ensino.gif" ToolTip="Ensino"
OnClick="Button1_Click" runat="server" /></td>
<td><asp:ImageButton ID="button2Panel5"
AlternateText="Curriculum Vitae"
ImageUrl="image/button-curriculum-vitae.gif" ToolTip="Curriculum Vitae"
OnClick="Button2_Click" runat="server" /></td>
<td><asp:ImageButton ID="button3Panel5"
AlternateText="Localização" ImageUrl="image/button-localizacao.gif"
ToolTip="Localização" OnClick="Button3_Click" runat="server" /></td>
<td><asp:ImageButton ID="button4Panel5"
AlternateText="Documentos Publicados"
ImageUrl="image/button-documentos-publicados.gif" ToolTip="Documentos
Publicados" OnClick="Button4_Click" runat="server" /></td>
<td><img src="image/button-contacte-me-hit.gif" width="75"
height="18"></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Panel 05</td>
</tr>
</table>
</td>
</tr>
</table>
</asp:Panel>
</form>
</body>
</html>



Can you tell me what is going on?
 
Hi Miguel,

You cannot push a button that is not on the form, I did not make this
completly well because for that is to much work, however you can try this.
'At the end of the load event (where you can delete that viewstate sentence
in my opinion, I forgot it to delete in my last sample from the first)
\\\
if not ispostback then
paneldados1.visible = True
End if
End Sub
'and than everytime make the next panel visible
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.Web.UI.ImageClickEventArgs)
panelDados1.Visible = True
panelDados2.visible = true
End Sub
///
 
Back
Top