Search code examples
asp.netcssajaxcontroltoolkitpositioningmodalpopupextender

ASP.Net Modal Popup position


I have a web user control with a modal popup extender in it. the modal popup contains an asp:Panel control in it. This panel contains other controls.
I'd like to make the modal popup scroll as the user scrolls the page. (position:absolute)

  • Tried to set X and Y properties of the popup extender. it changes the X and Y properties of the popup. But still: position:fixed

  • Tried to set the Panel's CssClass to (.ModalWindow) which has the following defiition: .ModalWindow{position:absolute;} But the position:fixed overrides it.

  • Tried to wrap the asp:Panel in a div: <div style="position:absolute;"> But still no luck.


Solution

  • Have you tried the following:

    .ModalWindow {position: absolute!important;}

    The !important override is a really handy trick, particularly when working with ASP.NET controls.

    Here's a bit more about it: http://www.electrictoolbox.com/using-important-css/