470,636 Members | 1,991 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,636 developers. It's quick & easy.

Refreshing parent page from a child page opened as a modal dialog boxOptions

Default.aspx is the starting page containing a control(ascx) which
asp:button control on it. On the button click event it has to open a
new page as a modal control. Since refreshing a page in a dialog box
ended up opening up a new browser window with the aspx page, I read
a forum that I should use the iframe control and since I have to open
a bunch of pages as diaogboxes, I created a general
page(Container.aspx) which has an iframe control on it, which I then
pass a parameter(pageToGoTo) specifying the aspx page that has to be
opened as a dialogbox.

Sequence of events and code are as follows:
On the default.aspx page I have added a control with a button. On the
button click server side event on that control, I call an aspx page.
string script = String.Format("window.showModalDialog(\"{0}?
pageToGoTo=testWebForm01.aspx\", \"testWebForm01.aspx
\" ,'dialogWidth=520px;dialogHeight=650px;dialogTop=1 25px;dialogLeft=125px;');*",
script, true);
On the Container.aspx I have an iframe control called frameTest which
I load on Page_Load event as follows
string pageToGoTo =
frameTest.Attributes["src"] = pageToGoTo;
This is then able to load the testWebForm01.aspx in the iframe
Now on a button click event on testWebForm01.aspx I want to close the
testWebForm01 form and reload default.aspx so that the control on
default.aspx. I added the following javascript code to
function refreshParent()
window.opener.location.href = window.opener.location.href;
if (window.opener.progressWindow)
// parent.refresh();
// self.close();
and called it on the server side button_click event as follows
string script = "refreshParent()";
script, true);
I keep getting window.opener is null error.
I read on another forum that if we have used showModalDialog method
then window.opener method is not initialized.
I did play around with trying to initialize it but haven't had any
Does anybody have any idea on how refreshing the parent page can be
accomplished? Please let me know.
Oct 31 '08 #1
0 1920

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by luna | last post: by
1 post views Thread by Korara | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.