I have a generic page below as a tester for refreshing the page from the closing of the Modal dialog window:
<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Main.aspx.cs" Inherits="Test_ApplicationPageRefresh.Layouts.Test_ApplicationPageRefresh.Main" DynamicMasterPageFile="~masterurl/default.master" %>
<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
<script language="javascript" type="text/javascript" >
function openCommentsDialog() {
var options = {
url: "/_layouts/PopOut.aspx",
title: 'Pop Out',
allowMaximize: false,
showClose: true,
width: 800,
height: 330,
dialogReturnValueCallback: Function.createDelegate(null, function (result, returnValue) {
SP.UI.ModalDialog.RefreshPage(result);
RefreshPage();
}
)
};
SP.UI.ModalDialog.showModalDialog(options);
}
function ReloadPage() {
window.location.reload();
}
</script>
</asp:Content>
<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
Main Page
<input id="Button1" type="button" value="Press Me" onclick="openCommentsDialog();"/>
<asp:Label
ID="lblRefresh" runat="server" Text="Before"></asp:Label>
</asp:Content>
<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
Application Page
</asp:Content>
<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
My Application Page
</asp:Content>
The delegate function never fires however and the page is never refreshed. I am wondering why the page never refreshes?