Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. show or hide Panel using ajax or javascript

show or hide Panel using ajax or javascript

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptquestion
9 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vipin d
    wrote on last edited by
    #1

    hi all, I am using MS.NET 2005 and Ajax.dll in my web application. How can I hide or show panel on dropdown item selected event(on change event). Thanks in advance!!

    All I ever wanted is what others have....
    CrazySanker

    P V 2 Replies Last reply
    0
    • V Vipin d

      hi all, I am using MS.NET 2005 and Ajax.dll in my web application. How can I hide or show panel on dropdown item selected event(on change event). Thanks in advance!!

      All I ever wanted is what others have....
      CrazySanker

      P Offline
      P Offline
      Parwej Ahamad
      wrote on last edited by
      #2

      Hide: document.getElementById('panelid').style.display = 'none' Show: document.getElementById('panelid').style.display = 'block'

      Parwej Ahamad g.parwez@gmail.com

      V 1 Reply Last reply
      0
      • P Parwej Ahamad

        Hide: document.getElementById('panelid').style.display = 'none' Show: document.getElementById('panelid').style.display = 'block'

        Parwej Ahamad g.parwez@gmail.com

        V Offline
        V Offline
        Vipin d
        wrote on last edited by
        #3

        Hi Friend, Thank you for your quick reply. But unfortunately it is not working.. <table> <tr> < td >hai sanker <td> </tr > < asp:panel id=p1 style="display:block;" <tr> < td >sanker@sanker.com <td> </tr > > </asp:panel > <tr> < td > ph:0501651816 <td> </tr > </table> or on cahnge event of dropdwon function mypanel() { alert('hai'); document.getElementById('p1 ').style.display = 'none' } that alert is wrking but hide is not wrking. any idea??

        All I ever wanted is what others have....
        CrazySanker

        P P 2 Replies Last reply
        0
        • V Vipin d

          Hi Friend, Thank you for your quick reply. But unfortunately it is not working.. <table> <tr> < td >hai sanker <td> </tr > < asp:panel id=p1 style="display:block;" <tr> < td >sanker@sanker.com <td> </tr > > </asp:panel > <tr> < td > ph:0501651816 <td> </tr > </table> or on cahnge event of dropdwon function mypanel() { alert('hai'); document.getElementById('p1 ').style.display = 'none' } that alert is wrking but hide is not wrking. any idea??

          All I ever wanted is what others have....
          CrazySanker

          P Offline
          P Offline
          Parwej Ahamad
          wrote on last edited by
          #4

          In id you have use sapce: document.getElementById**('p1 ').**style.display = 'none' document.getElementById('p1')style.display = 'none'

          Parwej Ahamad g.parwez@gmail.com

          V S 2 Replies Last reply
          0
          • V Vipin d

            Hi Friend, Thank you for your quick reply. But unfortunately it is not working.. <table> <tr> < td >hai sanker <td> </tr > < asp:panel id=p1 style="display:block;" <tr> < td >sanker@sanker.com <td> </tr > > </asp:panel > <tr> < td > ph:0501651816 <td> </tr > </table> or on cahnge event of dropdwon function mypanel() { alert('hai'); document.getElementById('p1 ').style.display = 'none' } that alert is wrking but hide is not wrking. any idea??

            All I ever wanted is what others have....
            CrazySanker

            P Offline
            P Offline
            Paras Kaneriya
            wrote on last edited by
            #5

            try using function ShowPanel() { alert('hai'); document.getElementById('p1').style.display = 'block'; } and on cahnge event of dropdwon function mypanel() { alert('hai'); document.getElementById('p1').style.display = 'none' }

            Paras Kaneriya
            The difference between genius and stupidity is that genius has its limits.

            V 1 Reply Last reply
            0
            • P Parwej Ahamad

              In id you have use sapce: document.getElementById**('p1 ').**style.display = 'none' document.getElementById('p1')style.display = 'none'

              Parwej Ahamad g.parwez@gmail.com

              V Offline
              V Offline
              Vipin d
              wrote on last edited by
              #6

              i remove that space.. but it is not still not functioning!!:sigh:

              All I ever wanted is what others have....
              CrazySanker

              1 Reply Last reply
              0
              • P Parwej Ahamad

                In id you have use sapce: document.getElementById**('p1 ').**style.display = 'none' document.getElementById('p1')style.display = 'none'

                Parwej Ahamad g.parwez@gmail.com

                S Offline
                S Offline
                Sandeep Akhare
                wrote on last edited by
                #7

                While using javascript check how the applicaion works in other browsers like mozilla i.e test your application in other browsers also if you want your application to be browser compliant

                Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

                1 Reply Last reply
                0
                • P Paras Kaneriya

                  try using function ShowPanel() { alert('hai'); document.getElementById('p1').style.display = 'block'; } and on cahnge event of dropdwon function mypanel() { alert('hai'); document.getElementById('p1').style.display = 'none' }

                  Paras Kaneriya
                  The difference between genius and stupidity is that genius has its limits.

                  V Offline
                  V Offline
                  Vipin d
                  wrote on last edited by
                  #8

                  thanks for ur reply. sorry,where we call ShowPanel() function.

                  All I ever wanted is what others have....
                  CrazySanker

                  1 Reply Last reply
                  0
                  • V Vipin d

                    hi all, I am using MS.NET 2005 and Ajax.dll in my web application. How can I hide or show panel on dropdown item selected event(on change event). Thanks in advance!!

                    All I ever wanted is what others have....
                    CrazySanker

                    V Offline
                    V Offline
                    Vipin d
                    wrote on last edited by
                    #9

                    Actually i am using Ajax.dll. i am new to this AJAX wrold also. my doubt is though ajax we can enable or hide panale?? means i ave a c# function like [Ajax.AjaxMethod] public string ChangeMe() { if (DrpDelMode.SelectedValue == "B") { Pnlcounter.Visible = false; PnlBankDet.Visible = true; TxtPaymentDetails.Rows = 8; } else { Pnlcounter.Visible = true; PnlBankDet.Visible = false; TxtPaymentDetails.Rows = 4; } TxtPaymentDetails.Text = DrpDelMode.SelectedItem.Value; return "Hai Ajax"; } On change event of a dropdwon control i can invoke a JS function function showpanle() { alert('ha1'); showpanel.ChangeMe(callback_Show); } function callback_Show(res) { document.getElementById("TxtPaymentDetails").innerText = res.value; } in this above piece of code alert wrking fine and document.getElementById("TxtPaymentDetails").innerText value is null how can i can solve this issue?

                    All I ever wanted is what others have....
                    CrazySanker

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups