Sunday, March 11, 2012

ModalPopup broken after July CTP (update from May)

I don't see any significant ModalPopup changes in the 60731 release that would cause problems. Maybe if you try this under Firefox and see if the JavaScript console is reporting any errors? If not, please post a simple sample demonstrating the problem. Thanks!
OK, so I created a very simple page and tested it with the 5/4/2006 build it works fine, however, it does not work with the 7/31/06 build.

<%@. Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="modules_test" %>
<%@. Register Assembly="AtlasControlToolkit" Namespace="AtlasControlToolkit" TagPrefix="atlasToolkit" %
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>

<style type="text/css">
.modalBackground {
background-color:Gray;
filter:alpha(opacity=70);
opacity:0.7;
}

.modalPopup {
background-color:#ffffdd;
border-width:3px;
border-style:solid;
border-color:Gray;
padding:3px;
}

.unwatermarked
{
height:18px;
width:148px;
}

.watermarked
{
height:20px;
width:150px;
padding:2px 0 0 2px;
border:1px solid #BEBEBE;
background-color:#F0F8FF;
color:gray;
}
</style>
</head>
<body>
<atlas:ScriptManager id="AtlasPage1" runat="server" enablepartialrendering="true" />
<form id="form1" runat="server">
<div>
<a href="http://links.10026.com/?link=javascript: $object('MP1')._show();">Edit</a>
</div>


<div style="display:none">
<asp:Panel ID="Panel1" runat="server" CssClass="modalPopup">
<atlas:updatepanel id="up" runat="server" mode="Always" rendermode="Inline">
<contenttemplate>
<br />
<h4>Edit Register Record</h4
This is the new page.

<center>
<asp:Button ID="OkButton" runat="server" Text="OK"></asp:Button>
<asp:Button ID="CancelButton" runat="server" Text="Cancel"></asp:Button>
</center>

<input type="hidden" id="hidRegID" value="" />
</contenttemplate>
</atlas:updatepanel>
</asp:Panel>
</div>

<div style="display: none">
<input type="hidden" id="hidID" name="hidID" runat="server" value="" />
<asp:LinkButton runat="server" ID="lnkButton" Text="Hidden" />
</div
<script language="javascript"
function Add_Complete(result)
{

}

function Add_Timeout()
{
alert("timeout");
}

function Add_Error(result, response)
{
alert(response.get_statusCode());
}

function onOk()
{
PageMethods.saveModal(OK_Complete, OK_Timeout, OK_Error)
}

function OK_Complete()
{
alert("ok");
}

function OK_Timeout()
{
alert("timeout");
}

function OK_Error(result, response)
{
alert("error: " + response.get_statusCode());
}
</script>

<atlasToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server">
<atlasToolkit:ModalPopupProperties ID="MP1" TargetControlID="lnkButton" PopupControlID="Panel1" BackgroundCssClass="modalBackground" DropShadow="true" OkControlID="OkButton" OnOkScript="onOk()" CancelControlID="CancelButton" />
</atlasToolkit:ModalPopupExtender>

</form>
</body>
</html
with code behind here:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Web.Services;

public partial class modules_test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}

[WebMethod()]
public void saveModal(string strRegID, string strPayeeID, string strRegDate, string strRegNumber, string strRegPayment, string strRegDeposit, string strRegMemo, string strRegRecon, string strChartID)
{

}
}

Any suggestions would be great.

Thanks,

Richard
Oh and I forgot - there was nothing in the Firefox JavaScript console - other than saying that unknown property of filter.

Richard
I think maybe you had a version of ModalPopup that was two or more release ago. To fix the problem you're having, remove the DIV/display:none wrapper around Panel1. You can set display:none on Panel1 itself to achieve the same effect.
Perfect. That solved my problem. Hate it when such simple things can goof up a page.

Thanks David.

Richard

No comments:

Post a Comment