Sunday, March 11, 2012

Modalpopup and Masterpages

Could you please have a look at my post in this thread:http://forums.asp.net/thread/1355399.aspx. I'm thinking you may be hitting the same nesting issue?
I think we're having the same problem. I reworked ModalPopup, but it didn't work for my problem (as I thought it would, since there is no mention of this in that thread). I'll see what I can do with css to fix it.
Fiddeling with the css fixed my problem. Thanks for pointing me in the right direction!

LodewijkConba,

I'm having the same problem and after long hours investigating I could't find a solution. Could you be so kind and post your's?

Thaks a lot,

Renato


Hi all,

I found a solution to the problem of modalpopup background not covering all page (and popup not screen centered) when it is placed inside a div (in my case a UserControl inside a ContentPlaceholder). The trick is to force the popup panel to be the chaild of the body element of the page. This is snippet of a script I added to my control HTML and it works like a charm. Please note thatpnlOptions is my popup panel.

I hope this helps others with this problem.

Regards,

Renato

<scripttype="text/javascript">

window.setTimeout("ChangePopupParent()", 1000);

function ChangePopupParent()

{

var panel = $('<% =pnlOptions.ClientID %>');

panel = panel.parentNode.removeChild(panel);

//Coloquemos o painel como filho do nó BODY

var bodies = document.getElementsByTagName('BODY');

if (bodies.length > 0)

bodies[0].appendChild(panel);

}


good job on the solution renado... I had to adjust it a little bit to make it work for me though.

on the part where you declare your panel variable in js.

What I did was place a div with an id of 'divPanel' around the panel that I wished to use as my popup panel. So my code looked like this.

I couldn't get it to work the way you had it, but the code below worked perfect for me, in case anyone else had a similar situation.


<scripttype="text/javascript">

window.setTimeout("ChangePopupParent()", 1000);

function ChangePopupParent()

{

var panel = document.getElementByID('divPanel');

panel = panel.parentNode.removeChild(panel);

//Coloquemos o painel como filho do nó BODY

var bodies = document.getElementsByTagName('BODY');

if (bodies.length > 0)

bodies[0].appendChild(panel);

}



I still have an issue trying to use the ModalPopupExtender. The greyed-out portion is not over the entire screen and it seems to have the upper-left corner of the background cover attached to a div that is not at the highest level of the document body. The popup is then centered into this grey area, which is not centered in the browser. Any other ideas on this one?


Are you using the 10618 release of the Toolkit? Kirti made a number of improvements in this area that should help you out.


I know we have a release that is the most recent as of a week ago. The ModalPopupExtender seems to work just as intended on Firefox, Safari, and IE 7. The problem now is with IE 6. At first, it was displaying the same behavior on all browsers (see the screenshot at the start of this thread - mine was just like that). To fix it on current browsers, I just had to put the panel inside a fixed position div. Now it greys out the whole screen and centers the popup correctly, no matter where you are scrolled. The problem now is IE 6. I know it doesn't really support fixed position (thanks, MS!) so I need a solution that will work with its busted CSS support.

Hi! I hope I understand the problem you posted correctly. The "grey-area" is only over the ContentPlaceHolder and not the whole Masterpage.
I fixed it with CSS like that:

.modalBackground
{
background-color:white;
filter:alpha(opacity=70);
opacity:0.7;
margin-top:-20px;
}

Maybe it helps someone who is searching for that.

No comments:

Post a Comment