Tuesday, January 29, 2008 3:34 PM kevinisom

Hiding a Popup Panel with JavaScript

Had a instance where I needed to close the Popup Control with JavaScript

   1:  <ajax:PopupControlExtender ID="pceShowPanel" runat="server"
   2:      TargetControlID="showPanel"
   3:      PopupControlID="popupPanel" 
   4:      BehaviorID="popupBehavior"                 
   5:      />

So with that on your page just hide it with hidePopup().

   1:  function Hide(){
   2:      $find('popupBehavior').hidePopup()
   3:  }

Of course you can show the popup as well with the showPopup() method. The real trick here is the $find shortcut method. The FindComponent method does just that and get's the component in this case the PopupExtender and allows you to call the methods associated with that control.

Filed under: , , ,

Comments

# re: Hiding a Popup Panel with JavaScript

Tuesday, April 08, 2008 11:13 PM by Mark Luhring

Kevin,

I am trying to find a way to toggle a panel open and closed using the PopupControlExtender.  I am not having any luck.  If I set the TargetControlId to a hidden control and try to use showPopup() and hidePopup() in a javascript function called by clicking on an imageButton nothing happens.

Do you have any insight into this.  I think I could make this work with the ModalPopupExtender, except I don't want the popup panel to be modal.

Mark

mluhring@yahoo.com

# re: Hiding a Popup Panel with JavaScript

Thursday, August 26, 2010 2:04 PM by Brandon

I'm trying to issue the $find('popupBehavior'); command in the Google Chrome console, and it can't find anything.

I've also tried to issue similar commands from other posts, but the objects just can't be found.

Any ideas?

# re: Hiding a Popup Panel with JavaScript

Sunday, July 15, 2012 3:45 AM by Seo Services

aWqS8C Im obliged for the blog article. Want more.

# re: Hiding a Popup Panel with JavaScript

Wednesday, September 19, 2012 10:44 AM by bookmarking submission

kHtZ3H Awesome article.Much thanks again. Much obliged.

# re: Hiding a Popup Panel with JavaScript

Sunday, March 10, 2013 9:05 AM by Eldridge

With havin so much written content do you ever run into any issues of plagorism

or copyright violation? My blog has a lot of completely

unique content I've either authored myself or outsourced but it looks like a lot of it is popping it up all over the web without my agreement. Do you know any solutions to help prevent content from being ripped off? I'd certainly appreciate it.

Leave a Comment

(required) 
(required) 
(optional)
(required)