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?
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:Ot**************@TK2MSFTNGP09.phx.gbl...
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>