Archive

Archive for October 13th, 2009

Clientside Repositioning a Modal Popup Extender

October 13th, 2009

When using the built in Modal Popup Extender for Ajax .Net, if you add any data or controls dynamically, you will notice that the Modal Popup has become unaligned or has breached it’s original size. Changing the size through CSS and Javascript is simple, however the position of the Modal Popup cannot be achieved in the same way.

To reposition the Modal Popup alignment, simply call the following function within your javascript. This will force the popup to recenter itself within the page.

$find('ModalPopupID')._layout();

Also, for people’s information, there are different properties for the automatic repositioning of the Modal Popup. These probably are never of use, unless you want to prevent the Modal Popup from realigning automatically.

Reposition Mode:

  • None
  • RepositionOnWindowResize
  • RepositionOnWindowResizeAndScroll
  • RepositionOnWindowScroll

Techie , , ,