Gordon Thompson
Gordon Thompson

Reputation: 4844

Putting ModalPopupExtender in a constant location

I've got a series of ModalPopupExtenders that I'm using to implement popup dialogs on an ASP.NET 2.0 page.

When they popup it's fairly easy to specify the location where they appear using the constructor using X and Y coordinates but I'm unsure how to deal with changes of window size which alters where they should be in cartesian space. I need them to appear relative to some other elements on the page.

I've tried hooking into the onresize javascript function in IE but this is broken and fires whenever a div changes size (problematic really given that i have lots of CollapsiblePanelExtenders in the UI.

Anybody ever done this and have any suggestions how i can get this working?

Edit : This code helps no end in capturing the resize event... http://blog.stchur.com/2006/09/06/the-ie-resize-bug-revisited/

Upvotes: 1

Views: 927

Answers (2)

mamashare
mamashare

Reputation: 409

ModalPopupExtender has a property called RepositionMode for exactly this purpose

Upvotes: 0

Gordon Thompson
Gordon Thompson

Reputation: 4844

I've figured out how to do this.

I use onClickClick to display the modal popup after figuring out where to put them by getting the x + y coordinates from a known control from the DOM. Upon resize (from http://blog.stchur.com/2006/09/06/the-ie-resize-bug-revisited/) i've decided to just hide the popups

Upvotes: 1

Related Questions