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. Updating Control outside Update pannel

Updating Control outside Update pannel

Scheduled Pinned Locked Moved ASP.NET
questionannouncement
4 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.
  • M Offline
    M Offline
    Milind R Chavan
    wrote on last edited by
    #1

    Hello, I have one treeview in updatepanel and one asp pannel(with visible = "false") out-side updatepanel. On selectedIndexchanged of treeview, I want a pannel outside of updatepanel needs to be visible. But it is not working. Is there any work around so that I can make my pannel visible w/o postback? Thanks in advance. Regards, Milind.

    C A N 3 Replies Last reply
    0
    • M Milind R Chavan

      Hello, I have one treeview in updatepanel and one asp pannel(with visible = "false") out-side updatepanel. On selectedIndexchanged of treeview, I want a pannel outside of updatepanel needs to be visible. But it is not working. Is there any work around so that I can make my pannel visible w/o postback? Thanks in advance. Regards, Milind.

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

      If it's not inside an update panel, then you'd need to write your own javascript to make it visible.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      1 Reply Last reply
      0
      • M Milind R Chavan

        Hello, I have one treeview in updatepanel and one asp pannel(with visible = "false") out-side updatepanel. On selectedIndexchanged of treeview, I want a pannel outside of updatepanel needs to be visible. But it is not working. Is there any work around so that I can make my pannel visible w/o postback? Thanks in advance. Regards, Milind.

        A Offline
        A Offline
        Abhishek Sur
        wrote on last edited by
        #3

        All the content that is inside the Update panel will be posted back to the client and refreshed in the client as response. So it is impossible to update controls outside updatepanel from the server. As Christian suggested, you need to pass some Javascript to the client which might show the Panel. But there is another scenario. ASP.NET doesnt render controls that are made Visible=false. So from client side using javascript, you will not going to find the control. So the solution will be : 1. Use pnl.Style.Add(HtmlTextWriterStyle.Display, "none") to make the panel invisible instead of pnl.Visible=false //To ensure that pnl is rendered in the client. 2. In postback of UpdatePanel use RegisterStartupScript to pass a javascript that resets the pnl.style. Your javascript might look like "document.getElementById('" + pnl.ClientId + "').style.display='none';" :-D

        Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


        My Latest Articles-->** Simplify Code Using NDepend
        Basics of Bing Search API using .NET
        Microsoft Bing MAP using Javascript

        1 Reply Last reply
        0
        • M Milind R Chavan

          Hello, I have one treeview in updatepanel and one asp pannel(with visible = "false") out-side updatepanel. On selectedIndexchanged of treeview, I want a pannel outside of updatepanel needs to be visible. But it is not working. Is there any work around so that I can make my pannel visible w/o postback? Thanks in advance. Regards, Milind.

          N Offline
          N Offline
          Nishant Singh
          wrote on last edited by
          #4

          Or you could put ASP:Panel inside another update Panel and set it's update mode to Always, But I think javascript will still be better

          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