I use a ModalPopupExtender within a User Control. Under the first release of the AtlasControlToolkit everything was working perfectly.
When I installed the lastest verion of the tookit, the modal popup started acting strange. Instead of being centered on the page, it was shifted down and to the right.
Obviously that's what happens when the code thinks the parent containiner in DOM in something other than the body.
I used Beyond Compare to compare the old Modal Popup code to the new code, and found there were some JavaScript changes, so I first eliminated that as a problem by reverting to the old version's JS file. It did not have an effect.
There seems to be no changes at all in the .NET code for ModalPopup, so I am left to assume that there was some change made to AtlasControlExtender that is causing the problem.
If I had access to the AtlasControlExtender code, I would recommend a change here, but I don't have access. Is MS going to release that code at some point?
I have created a complete test page (below) that demonstrates the problem in action. If you include the new AtlasControlToolkit (6/26/2006), it will exhibit the problem. If you swap in the old toolkit binaries, it will work as it should (covering and centering on the whole page).
If a MS developer looks at this (I hope you do!), PLEASE do not suggest changing the order or placement of the form, DIV tags, etc. I know full well that removing the DIV with the "position:relative" style will make everything work, but this code represents the basic framework elements of a complex web site that cannot be changed to suit a bug in the ModalPopup extender.
The Modal Popup code should work perfectly no matter where it is dropped in, and no matter where in the DOM it is inserted. Since the first version worked fine, this can obviously be achieved.
Thank you very much for looking into this, and I'd appreciate anything you could offer to fix it (including a bug fix, if possible).
<%@ Page Language="VB" AutoEventWireup="false" EnableViewState="false" %>
<%@ Register Assembly="AtlasControlToolkit" Namespace="AtlasControlToolkit" TagPrefix="AtlasToolkit" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Modal Test Page</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="cache-control" content="no-cache" /><meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="expires" content="0" />
<style type="text/css">
.modalBackground {
background-color:Gray;
filter:alpha(opacity=70);
opacity:0.7;
}
</style>
</head>
<body>
<Atlas:ScriptManager ID="AtlasScriptManager" runat="server" />
<table id="mainframework" border="0" cellspacing="10" cellpadding="0">
<tr>
<td id="mainframeworkleft">
Left Col
</td>
<td id="mainframeworkbody">
<form id="form1" runat="server">
<div style="position:relative">
<asp:Panel ID="PreviewPanel" style="display:none;" runat="server">
<div class="wrapper">
<strong>Popup Window!</strong>
<asp:HyperLink ID="PreviewCloseButton" Text="Close" runat="server" />
</div>
</asp:Panel>
<AtlasToolkit:ModalPopupExtender ID="ModalPopupExtender" runat="server">
<AtlasToolkit:ModalPopupProperties ID="mpPreview" TargetControlID="Preview" PopupControlID="PreviewPanel" BackgroundCssClass="modalBackground" DropShadow="false" CancelControlID="PreviewCloseButton" />
</AtlasToolkit:ModalPopupExtender>
<asp:LinkButton ID="Preview" Text="Preview" runat="server" />
</div>
</form>
</td>
</tr>
</table>
</body>
</html>