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. Hide panel control in javascript.

Hide panel control in javascript.

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptasp-netsysadmin
5 Posts 5 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.
  • N Offline
    N Offline
    Nagraj Naik
    wrote on last edited by
    #1

    Hi, I have used panel server control on my webpage in asp.net. I want to hide this panel on button click. which property I need to set. I tried document.getElementById(pnlColumn).style.display=none but it won't work. Thanks, Nagraj.

    F U N C 4 Replies Last reply
    0
    • N Nagraj Naik

      Hi, I have used panel server control on my webpage in asp.net. I want to hide this panel on button click. which property I need to set. I tried document.getElementById(pnlColumn).style.display=none but it won't work. Thanks, Nagraj.

      F Offline
      F Offline
      firozu
      wrote on last edited by
      #2

      If your button_click has a postback than its better to hide the panel during postback, rather than using javascript.

      1 Reply Last reply
      0
      • N Nagraj Naik

        Hi, I have used panel server control on my webpage in asp.net. I want to hide this panel on button click. which property I need to set. I tried document.getElementById(pnlColumn).style.display=none but it won't work. Thanks, Nagraj.

        U Offline
        U Offline
        Unknown Ajanabi
        wrote on last edited by
        #3

        hi i hope following link help u. http://forums.asp.net/p/619746/619901.aspx[^]

        no knowledge in .net

        1 Reply Last reply
        0
        • N Nagraj Naik

          Hi, I have used panel server control on my webpage in asp.net. I want to hide this panel on button click. which property I need to set. I tried document.getElementById(pnlColumn).style.display=none but it won't work. Thanks, Nagraj.

          N Offline
          N Offline
          N Surendra Prasad
          wrote on last edited by
          #4

          Try this, document.getElementById('pnlColumn').style.display='none'; Regards N.Surendra Prasad

          1 Reply Last reply
          0
          • N Nagraj Naik

            Hi, I have used panel server control on my webpage in asp.net. I want to hide this panel on button click. which property I need to set. I tried document.getElementById(pnlColumn).style.display=none but it won't work. Thanks, Nagraj.

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            First of all, if it's an ASP.NET control, then the name of the control on the client is not the name on the server, you need to write the name using the server controls 'ClientID' property. Then you can use code like the above, assuming that pnlColumn is a variable that holds the client side Id, and that you put 'none' in quotes.

            Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

            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