M
Miguel Dias Moura
Hi Cor and everybody else,
i created a page with 5 panels and 5 buttons which control them acording to
Cor's help.
After this i used 5 image buttons instead of standard buttons.
When i run the page i don't get any error but at the same time i don't see
anything.
I am doing something wrong here. Can you, Cor, or somebody else point me
what is wrong?
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 visitor is.
Just paste the following code in an empty page and you will have exactly
what i have:
<%@ 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
anel 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
anel>
<asp
anel 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>
i created a page with 5 panels and 5 buttons which control them acording to
Cor's help.
After this i used 5 image buttons instead of standard buttons.
When i run the page i don't get any error but at the same time i don't see
anything.
I am doing something wrong here. Can you, Cor, or somebody else point me
what is wrong?
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 visitor is.
Just paste the following code in an empty page and you will have exactly
what i have:
<%@ 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

<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

<asp

<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>