Make panels visible and invisible.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Miguel Dias Moura

    Make panels visible and invisible.

    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


  • Cor Ligthert

    #2
    Re: Make panels visible and invisible.

    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


    Comment

    • Cor Ligthert

      #3
      Re: Make panels visible and invisible.

      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.EventArg s) 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(B yVal sender As System.Object, _
      ByVal e As System.EventArg s) 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
      ///


      Comment

      • Miguel Dias Moura

        #4
        Re: Make panels visible and invisible.

        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



        "Cor Ligthert" <notfirstname@p lanet.nl> wrote in message
        news:#bifTOKVEH A.3988@tk2msftn gp13.phx.gbl...[color=blue]
        > 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.EventArg s) 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(B yVal sender As System.Object, _
        > ByVal e As System.EventArg s) 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
        > ///
        >
        >[/color]


        Comment

        • Cor Ligthert

          #5
          Re: Make panels visible and invisible.

          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>Sample 1</title>
          <script language="VB" runat="server">
          Private Sub Page_Load(ByVal sender As System.Object, _
          ByVal e As System.EventArg s)
          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(B yVal sender As System.Object, _
          ByVal e As System.EventArg s)
          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="T RUE">
          <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="T RUE">
          <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="Button 1_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="Do uble">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="Do tted">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="Ri dge">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="Ou tset">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="So lid">Panel
          <asp:Label id="Label5" runat="server"> 5</asp:Label></asp:Panel></TD>
          </TR>
          </TABLE>
          </form>
          </TD>
          </TR>
          </TABLE>
          </body>
          </HTML>
          [color=blue]
          > i allways have problems in making things work when this Handles... is[/color]
          used.[color=blue]
          > 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[/color]
          this[color=blue]
          > 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
          >[/color]


          Comment

          • Miguel Dias Moura

            #6
            Re: Make panels visible and invisible.

            Hi,

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

            Miguel

            "Cor Ligthert" <notfirstname@p lanet.nl> wrote in message
            news:OIN45IQVEH A.2692@TK2MSFTN GP09.phx.gbl...[color=blue]
            > 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[/color]
            scripting,[color=blue]
            > 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>Sample 1</title>
            > <script language="VB" runat="server">
            > Private Sub Page_Load(ByVal sender As System.Object, _
            > ByVal e As System.EventArg s)
            > 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(B yVal sender As System.Object, _
            > ByVal e As System.EventArg s)
            > 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="T RUE">
            > <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="T RUE">
            > <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="Button 1_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="Do uble">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="Do tted">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="Ri dge">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="Ou tset">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="So lid">Panel
            > <asp:Label id="Label5" runat="server"> 5</asp:Label></asp:Panel></TD>
            > </TR>
            > </TABLE>
            > </form>
            > </TD>
            > </TR>
            > </TABLE>
            > </body>
            > </HTML>
            >[color=green]
            > > i allways have problems in making things work when this Handles... is[/color]
            > used.[color=green]
            > > 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[/color]
            > this[color=green]
            > > 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[/color][/color]
            the[color=blue][color=green]
            > > address.
            > >
            > > Thank You,
            > > Miguel
            > >[/color]
            >
            >[/color]


            Comment

            • Miguel Dias Moura

              #7
              Re: Make panels visible and invisible.

              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( "CurrentPag e" ) = 1
              End If
              End Sub

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

              ' Hide Previous Panel
              strPanelName = "panelSubscribe " & ViewState( "CurrentPag e" )
              pnlPanel = FindControl( strPanelName )
              pnlPanel.Visibl e = False

              ' Show Current Panel
              ViewState( "CurrentPag e" ) += 1
              strPanelName = "panelSubscribe " & ViewState( "CurrentPag e" )
              pnlPanel = FindControl( strPanelName )
              pnlPanel.Visibl e = True

              End Sub

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

              ' Hide Current Panel
              strPanelName = "panelSubscribe " & ViewState( "CurrentPag e" )
              pnlPanel = FindControl( strPanelName )
              pnlPanel.Visibl e = False

              ' Show Previous Panel
              ViewState( "CurrentPag e" ) -= 1
              strPanelName = "panelSubscribe " & ViewState( "CurrentPag e" )
              pnlPanel = FindControl( strPanelName )
              pnlPanel.Visibl e = True

              End Sub

              Sub btnFinish_Click ( s As Object, e As EventArgs )[color=blue][color=green]
              >> Take some action[/color][/color]
              End Sub

              </script>



              "Miguel Dias Moura" <web001@27NOSPA Mlamps.com> wrote in message
              news:O#hYZ0YVEH A.3336@TK2MSFTN GP11.phx.gbl...[color=blue]
              > Hi,
              >
              > i tryied it but it doesn't work. I tryied to make some changes but nothing
              > happens.
              >
              > Miguel
              >
              > "Cor Ligthert" <notfirstname@p lanet.nl> wrote in message
              > news:OIN45IQVEH A.2692@TK2MSFTN GP09.phx.gbl...[color=green]
              > > Hi Miguel,
              > >
              > > Most people in this vb.language newsgroup are using Visual Studio Net[/color][/color]
              and[color=blue][color=green]
              > > with that they got compiled programs. However it can as well with[/color]
              > scripting,[color=green]
              > > 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>Sample 1</title>
              > > <script language="VB" runat="server">
              > > Private Sub Page_Load(ByVal sender As System.Object, _
              > > ByVal e As System.EventArg s)
              > > 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(B yVal sender As System.Object, _
              > > ByVal e As System.EventArg s)
              > > 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"[/color][/color]
              border="0"[color=blue][color=green]
              > > ms_2d_layout="T RUE">
              > > <TR vAlign="top">
              > > <TD width="490" height="533">
              > > <form id="Form1" method="post" runat="server">
              > > <TABLE height="473" cellSpacing="0" cellPadding="0" width="521"[/color][/color]
              border="0"[color=blue][color=green]
              > > ms_2d_layout="T RUE">
              > > <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="Button 1_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="Do uble">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="Do tted">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="Ri dge">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="Ou tset">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="So lid">Panel
              > > <asp:Label id="Label5" runat="server"> 5</asp:Label></asp:Panel></TD>
              > > </TR>
              > > </TABLE>
              > > </form>
              > > </TD>
              > > </TR>
              > > </TABLE>
              > > </body>
              > > </HTML>
              > >[color=darkred]
              > > > i allways have problems in making things work when this Handles... is[/color]
              > > used.[color=darkred]
              > > > 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[/color][/color][/color]
              like[color=blue][color=green]
              > > this[color=darkred]
              > > > i end up hitting my head in the walls :-)
              > > >
              > > > Could you send me a simple ASP.net file with 2 panels, 2 images and[/color][/color][/color]
              this[color=blue][color=green][color=darkred]
              > > > 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[/color][/color]
              > the[color=green][color=darkred]
              > > > address.
              > > >
              > > > Thank You,
              > > > Miguel
              > > >[/color]
              > >
              > >[/color]
              >
              >[/color]


              Comment

              • Cor Ligthert

                #8
                Re: Make panels visible and invisible.

                Hi Miguel,

                I tested this, this did work, what is not working?

                Cor[color=blue]
                >
                > i tryied it but it doesn't work. I tryied to make some changes but nothing
                > happens.[/color]


                Comment

                • Miguel Dias Moura

                  #9
                  Re: Make panels visible and invisible.

                  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

                  "Cor Ligthert" <notfirstname@p lanet.nl> wrote in message
                  news:uHElPybVEH A.2816@TK2MSFTN GP11.phx.gbl...[color=blue]
                  > Hi Miguel,
                  >
                  > I tested this, this did work, what is not working?
                  >
                  > Cor[color=green]
                  > >
                  > > i tryied it but it doesn't work. I tryied to make some changes but[/color][/color]
                  nothing[color=blue][color=green]
                  > > happens.[/color]
                  >
                  >[/color]


                  Comment

                  • Cor Ligthert

                    #10
                    Re: Make panels visible and invisible.

                    > you are right, it's working...i did a mistake when i pasted the code.[color=blue]
                    >
                    > 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?[/color]

                    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>Sample 1</title>
                    <script language="VB" runat="server">
                    Private Sub Page_Load(ByVal sender As System.Object, _
                    ByVal e As System.EventArg s)
                    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(B yVal sender As System.Object, _
                    ByVal e As System.EventArg s)
                    Panel1.Visible = True
                    End Sub
                    Private Sub Button2_Click(B yVal sender As System.Object, _
                    ByVal e As System.EventArg s)
                    Panel2.Visible = True
                    End Sub
                    Private Sub Button3_Click(B yVal sender As System.Object, _
                    ByVal e As System.EventArg s)
                    Panel3.Visible = True
                    End Sub
                    Private Sub Button4_Click(B yVal sender As System.Object, _
                    ByVal e As System.EventArg s)
                    Panel4.Visible = True
                    End Sub
                    Private Sub Button5_Click(B yVal sender As System.Object, _
                    ByVal e As System.EventArg s)
                    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="T RUE">
                    <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="T RUE">
                    <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="Button 1_Click" runat="server"
                    ID="Button1"></asp:Button>
                    <asp:Button text="Button2" OnClick="Button 2_Click" runat="server"
                    ID="Button1"></asp:Button>
                    <asp:Button text="Button3" OnClick="Button 3_Click" runat="server"
                    ID="Button1"></asp:Button>
                    <asp:Button text="Button4" OnClick="Button 4_Click" runat="server"
                    ID="Button1"></asp:Button>
                    <asp:Button text="Button5" OnClick="Button 5_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="Do uble">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="Do tted">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="Ri dge">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="Ou tset">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="So lid">Panel
                    <asp:Label id="Label5" runat="server"> 5</asp:Label></asp:Panel></TD>
                    </TR>
                    </TABLE>
                    </form>
                    </TD>
                    </TR>
                    </TABLE>
                    </body>
                    </HTML>






                    Comment

                    • Cor Ligthert

                      #11
                      Re: Make panels visible and invisible.

                      Hi Miguel,

                      I used a button, however you can of course as well use an imagebutton.
                      That goes the same.



                      I hope this helps?

                      Cor


                      Comment

                      • Miguel Dias Moura

                        #12
                        Re: Make panels visible and invisible.

                        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.EventArg s)
                        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.EventArg s)

                        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(B yVal sender As System.Object, _ByVal e As
                        System.EventArg s)

                        Panel1.Visible = True

                        End Sub

                        Private Sub Button2_Click(B yVal sender As System.Object, _ByVal e As
                        System.EventArg s)

                        Panel2.Visible = True

                        End Sub

                        Private Sub Button3_Click(B yVal sender As System.Object, _ByVal e As
                        System.EventArg s)

                        Panel3.Visible = True

                        End Sub

                        Private Sub Button4_Click(B yVal sender As System.Object, _ByVal e As
                        System.EventArg s)

                        Panel4.Visible = True

                        End Sub

                        Private Sub Button5_Click(B yVal sender As System.Object, _ByVal e As
                        System.EventArg s)

                        Panel5.Visible = True

                        End Sub

                        </script>


                        "Cor Ligthert" <notfirstname@p lanet.nl> wrote in message
                        news:uz#tzxsVEH A.1164@tk2msftn gp13.phx.gbl...[color=blue]
                        > Hi Miguel,
                        >
                        > I used a button, however you can of course as well use an imagebutton.
                        > That goes the same.
                        >
                        >[/color]

                        frlrfsystemwebu iwebcontrolsima gebuttonclassto pic.asp[color=blue]
                        >
                        > I hope this helps?
                        >
                        > Cor
                        >
                        >[/color]


                        Comment

                        • Miguel Dias Moura

                          #13
                          Re: Make panels visible and invisible.

                          P.S: the error is: BC30529: All parameters must be explicitly typed if any
                          are.

                          "Cor Ligthert" <notfirstname@p lanet.nl> wrote in message
                          news:uz#tzxsVEH A.1164@tk2msftn gp13.phx.gbl...[color=blue]
                          > Hi Miguel,
                          >
                          > I used a button, however you can of course as well use an imagebutton.
                          > That goes the same.
                          >
                          >[/color]

                          frlrfsystemwebu iwebcontrolsima gebuttonclassto pic.asp[color=blue]
                          >
                          > I hope this helps?
                          >
                          > Cor
                          >
                          >[/color]


                          Comment

                          • Cor Ligthert

                            #14
                            Re: Make panels visible and invisible.

                            Hi Miquel,

                            [color=blue]
                            > thanks for that image information. That's what i was looking for.
                            > About the code you are sending me i am getting an error:
                            >[/color]
                            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>Sample 1</title>
                            <script language="VB" runat="server">
                            Private Sub Page_Load(ByVal sender As System.Object, _
                            ByVal e As System.EventArg s)
                            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(B yVal sender As System.Object, _
                            ByVal e As System.EventArg s)
                            Panel1.Visible = True
                            End Sub
                            Private Sub Button2_Click(B yVal sender As System.Object, _
                            ByVal e As System.EventArg s)
                            Panel2.Visible = True
                            End Sub
                            Private Sub Button3_Click(B yVal sender As System.Object, _
                            ByVal e As System.EventArg s)
                            Panel3.Visible = True
                            End Sub
                            Private Sub Button4_Click(B yVal sender As System.Object, _
                            ByVal e As System.EventArg s)
                            Panel4.Visible = True
                            End Sub
                            Private Sub Button5_Click(B yVal sender As System.Object, _
                            ByVal e As System.EventArg s)
                            Panel5.Visible = True
                            End Sub
                            </script>
                            </HEAD>
                            <body MS_POSITIONING= "GridLayout ">
                            <form id="Form1" method="post" runat="server">
                            <asp:Button text="Button1" OnClick="Button 1_Click" runat="server"
                            ID="Button1" style="LEFT: 232px; POSITION: absolute; TOP:
                            48px"></asp:Button>
                            <asp:Button text="Button2" OnClick="Button 2_Click" runat="server"
                            ID="Button2" style="LEFT: 304px; POSITION: absolute; TOP:
                            48px"></asp:Button>
                            <asp:Button text="Button3" OnClick="Button 3_Click" runat="server"
                            ID="Button3" style="LEFT: 376px; POSITION: absolute; TOP:
                            48px"></asp:Button>
                            <asp:Button text="Button4" OnClick="Button 4_Click" runat="server"
                            ID="Button4" style="LEFT: 448px; POSITION: absolute; TOP:
                            48px"></asp:Button>
                            <asp:Button text="Button5" OnClick="Button 5_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="Do uble" 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="Do tted" 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="Ri dge" 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="Ou tset" 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="So lid" style="LEFT: 360px; POSITION: absolute; TOP:
                            416px">Panel
                            <asp:Label id="Label5" runat="server"> 5</asp:Label></asp:Panel>
                            </form>
                            </body>
                            </HTML>


                            Comment

                            • Miguel Dias Moura

                              #15
                              Re: Make panels visible and invisible.

                              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

                              "Cor Ligthert" <notfirstname@p lanet.nl> wrote in message
                              news:OtqwwhtVEH A.3024@TK2MSFTN GP09.phx.gbl...[color=blue]
                              > Hi Miquel,
                              >
                              >[color=green]
                              > > thanks for that image information. That's what i was looking for.
                              > > About the code you are sending me i am getting an error:
                              > >[/color]
                              > 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[/color]
                              work[color=blue]
                              > again as I expected.
                              >
                              > <HTML>
                              > <HEAD>
                              > <title>Sample 1</title>
                              > <script language="VB" runat="server">
                              > Private Sub Page_Load(ByVal sender As System.Object, _
                              > ByVal e As System.EventArg s)
                              > 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(B yVal sender As System.Object, _
                              > ByVal e As System.EventArg s)
                              > Panel1.Visible = True
                              > End Sub
                              > Private Sub Button2_Click(B yVal sender As System.Object, _
                              > ByVal e As System.EventArg s)
                              > Panel2.Visible = True
                              > End Sub
                              > Private Sub Button3_Click(B yVal sender As System.Object, _
                              > ByVal e As System.EventArg s)
                              > Panel3.Visible = True
                              > End Sub
                              > Private Sub Button4_Click(B yVal sender As System.Object, _
                              > ByVal e As System.EventArg s)
                              > Panel4.Visible = True
                              > End Sub
                              > Private Sub Button5_Click(B yVal sender As System.Object, _
                              > ByVal e As System.EventArg s)
                              > Panel5.Visible = True
                              > End Sub
                              > </script>
                              > </HEAD>
                              > <body MS_POSITIONING= "GridLayout ">
                              > <form id="Form1" method="post" runat="server">
                              > <asp:Button text="Button1" OnClick="Button 1_Click" runat="server"
                              > ID="Button1" style="LEFT: 232px; POSITION: absolute; TOP:
                              > 48px"></asp:Button>
                              > <asp:Button text="Button2" OnClick="Button 2_Click" runat="server"
                              > ID="Button2" style="LEFT: 304px; POSITION: absolute; TOP:
                              > 48px"></asp:Button>
                              > <asp:Button text="Button3" OnClick="Button 3_Click" runat="server"
                              > ID="Button3" style="LEFT: 376px; POSITION: absolute; TOP:
                              > 48px"></asp:Button>
                              > <asp:Button text="Button4" OnClick="Button 4_Click" runat="server"
                              > ID="Button4" style="LEFT: 448px; POSITION: absolute; TOP:
                              > 48px"></asp:Button>
                              > <asp:Button text="Button5" OnClick="Button 5_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="Do uble" style="LEFT: 360px; POSITION: absolute; TOP:
                              > 128px">Panel
                              > <asp:Label id="Label1" runat="server"[/color]
                              Width="64px">1</asp:Label></asp:Panel>[color=blue]
                              > <asp:Panel id="Panel2" runat="server" Width="160px" Height="48px"
                              > BorderStyle="Do tted" 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="Ri dge" 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="Ou tset" 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="So lid" style="LEFT: 360px; POSITION: absolute; TOP:
                              > 416px">Panel
                              > <asp:Label id="Label5" runat="server"> 5</asp:Label></asp:Panel>
                              > </form>
                              > </body>
                              > </HTML>
                              >
                              >[/color]


                              Comment

                              Working...