Hi,
I am displaying a popup window by setting ContentPane.ContentUrl property of WebDialogWindow to an .aspx page (let's say Sample.aspx). I have a close button on Sample.aspx page. I want to close the WebDialogWindow on Sample.aspx btnClose_Click() event.
Could you help me how to close WebDialogWindow on close button click???
Thanks you in advance.
Vijay Jaiswal
Hello Vijay,
If you execute the following client side code when the button on your content url page is clicked, it should close your dialog window.
function CloseButtonClick() {
var dw = window.parent.$find("WebDialogWindow1");
dw.hide();
}
-Taz.
Thanks for your reply. It's working. I have two more concern regarding this.
Thanks,
Hi Vijay,
Unfortunately such operations are beyond scope of WebDialogWindow. You can treat the ContentUrl as <iframe> located on main page which src is set to ContentUrl. All possible operations should be based on javascript. The best I can do for you, is to give an example to access objects located on main page from ContentUrl.
Assume that main page has TextBox1 which you want to update from TextBox1 located on ContentUrl and main page has a javascript function openerScript() which you want to call when your ContentUrl is submitted. To access main window you may use obects similar to parent, top, etc. Below is ContentUrl which does that.
<body> <form id="form1" runat="server" onsubmit="formSubmit()"> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <asp:Button ID="Button1" runat="server" Text="Button" /> </form></body>