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. Dropdownlist should trigger the panel

Dropdownlist should trigger the panel

Scheduled Pinned Locked Moved ASP.NET
databaseannouncement
6 Posts 3 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.
  • D Offline
    D Offline
    Devkranth Kishore Vanja
    wrote on last edited by
    #1

    hello every body i have a datagrid which is inside an Update panel, which contains a Dropdownlist with options "YES" and "No". on the Other End i have 2 panels namely p1 and p2 which is outside the UpdatePanel where p1 and p2 on form load visiblibity is set to False now my intention is to make p2 visbile=true on selecting the Dropdownlist which is inside the Datagrid Ex if dropdownlist ="YES" then p1.visible=true else p2.visible= false Thanks in Advance DevKranth

    L A 2 Replies Last reply
    0
    • D Devkranth Kishore Vanja

      hello every body i have a datagrid which is inside an Update panel, which contains a Dropdownlist with options "YES" and "No". on the Other End i have 2 panels namely p1 and p2 which is outside the UpdatePanel where p1 and p2 on form load visiblibity is set to False now my intention is to make p2 visbile=true on selecting the Dropdownlist which is inside the Datagrid Ex if dropdownlist ="YES" then p1.visible=true else p2.visible= false Thanks in Advance DevKranth

      L Offline
      L Offline
      Laxmikant Lad
      wrote on last edited by
      #2

      hi write the bubble event means write one protected functions like protected void visiblePanel(object sender, EventArgs e) { if dropdownlist ="YES" then p1.visible=true else p2.visible= false } in html set autopostback of drp to true and set the on OnSelectedIndexChanged = visiblePanel

      D 1 Reply Last reply
      0
      • D Devkranth Kishore Vanja

        hello every body i have a datagrid which is inside an Update panel, which contains a Dropdownlist with options "YES" and "No". on the Other End i have 2 panels namely p1 and p2 which is outside the UpdatePanel where p1 and p2 on form load visiblibity is set to False now my intention is to make p2 visbile=true on selecting the Dropdownlist which is inside the Datagrid Ex if dropdownlist ="YES" then p1.visible=true else p2.visible= false Thanks in Advance DevKranth

        A Offline
        A Offline
        amargujrathi2006
        wrote on last edited by
        #3

        In this case, you can use another Updatepanel to place those P1 and P2 in that Updatepanel. If not possible, then you can use javacript by registering it with Scriptmanager.registerClientScriptblock. I think one of the above method solve your problem. Regards, Amar Gujarathi cfoamar23@gmail.com

        D 1 Reply Last reply
        0
        • L Laxmikant Lad

          hi write the bubble event means write one protected functions like protected void visiblePanel(object sender, EventArgs e) { if dropdownlist ="YES" then p1.visible=true else p2.visible= false } in html set autopostback of drp to true and set the on OnSelectedIndexChanged = visiblePanel

          D Offline
          D Offline
          Devkranth Kishore Vanja
          wrote on last edited by
          #4

          hi laxmikant thanks for the response ... as u said i did the Same but the problem is when i debug the code the panels state are changing but it is not reflected in the Form...

          1 Reply Last reply
          0
          • A amargujrathi2006

            In this case, you can use another Updatepanel to place those P1 and P2 in that Updatepanel. If not possible, then you can use javacript by registering it with Scriptmanager.registerClientScriptblock. I think one of the above method solve your problem. Regards, Amar Gujarathi cfoamar23@gmail.com

            D Offline
            D Offline
            Devkranth Kishore Vanja
            wrote on last edited by
            #5

            hi amar thanks for u response.i think the first Case u said is not going to happen coz when i add an update panel to the P1 and p2 it gives me a message saying u have to add another Update panel the second option i am not clear can u briefly explain me..

            A 1 Reply Last reply
            0
            • D Devkranth Kishore Vanja

              hi amar thanks for u response.i think the first Case u said is not going to happen coz when i add an update panel to the P1 and p2 it gives me a message saying u have to add another Update panel the second option i am not clear can u briefly explain me..

              A Offline
              A Offline
              amargujrathi2006
              wrote on last edited by
              #6

              hi devkranth, For that you have to use javascript, first you need to find out the P1 and P2 id of the panel using javascript eg. function switchpanel(panelno) { var p1=document.getElementById("P1"); //find out P1 with its client ID var p2=document.getElementById("P1"); //find out P2 with its client ID if (panelno==1) { p1.style.display="block"; p2.style.display="none"; } else { p1.style.display="none"; p2.style.display="block"; } call this script on dropdown_change event with scriptmanager as previously mentioned. }

              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