Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
695
Return value from WebDialogWindow
posted

Hi,

I would like to know, is it possible to returnvalue from WebDialogWindow? (i.e) equivalent  to var retValue=  window.showmodaldialog. I have 2 questions with this.

1. How do I refresh Parent page?

2, How do I return value from child window?

ParentPage (webmenu.aspx)

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="WebMenu.aspx.cs" Inherits="RLCommonControls_WebMenu" %>

<%@ Register Assembly="Infragistics4.Web.v12.1, Version=12.1.20121.2020, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
Namespace="Infragistics.Web.UI.LayoutControls" TagPrefix="ig" %>
<%@ Register Assembly="Infragistics4.Web.v12.1, Version=12.1.20121.2020, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
Namespace="Infragistics.Web.UI" TagPrefix="ig" %>
<%@ Register Assembly="Infragistics4.Web.v12.1, Version=12.1.20121.2020, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
Namespace="Infragistics.Web.UI.NavigationControls" TagPrefix="ig" %>
<!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></title>
<script type="text/javascript">
function PageOpen() {
var dialog = $find("WebDialogWindow1");
dialog.get_contentPane().set_contentUrl('PopUp.aspx')
dialog.set_windowState($IG.DialogWindowState.Normal);
dialog.show();
return false;
}

</script>
</head>
<body>
<form id="form1" runat="server">
<ig:WebScriptManager ID="WebScriptManager1" runat="server">
</ig:WebScriptManager>
<ig:WebDialogWindow ID="WebDialogWindow1" runat="server" Width="50%" Height="50%"
WindowState="Hidden" />
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="PageOpen()" />
</form>
</body>
</html>

ChildPage (Popup.aspx)

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PopUp.aspx.cs" Inherits="RLCommonControls_PopUp" %>

<!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></title>
<script language="javascript">

function OnOK() {

var dialog = window.parent.$find("WebDialogWindow1");
// var dialog = $find("WebDialogWindow1");
dialog.hide();
window.parent.reload();
return false;

}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="btnClose" runat="server" Text="close" OnClientClick="OnOK()"/>
</div>
</form>
</body>
</html>

Please let me know, is this possible ASAP/