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/
Hello InfraOracle,
Thank you for sharing your solution with the community.
If you have any other questions, please do not hesitate to ask.
Finally I found solution my self
Answer : window.parent.location.reload();
Answer: Create javascript function in ParentPage and pass values from child window
Parent Page
function CallAlert() { alert("This is parent window's alert function."); }
In WebDialogWindow
window.parent.CallAlert(returnValue);