I am having a problem while refreshing my parent window.
I have a webform and I am using a viewstate on this form. on the viewstate's 3rd activeform I have a table. In a row of this table when the radiobutton's value is equal to No(I am doing an autopostback here) a popup window opens. Here on the popup window I make user to select some items in the checkbox list and carry the data to a textbox in the parent form. Till here everything is fine.
My problem is I can not close the popup. What happens is;
I can successfully pass the data to my parent window, refresh it but the popup windows closes and it popups again.
I am trying to do it with this code;
Page.RegisterStartupScript("CLOSE", "<script language="'javascript'">window.opener.document.forms(0).submit();self.close();</script>");
What I also tried;
ClientScript.RegisterStartupScript(typeof(Page), "closePage", "window.onunload = CloseWindow();");
Page.RegisterStartupScript("CLOSE", "<script language="'javascript'">window.opener.location.reload();self.close();</script>");
Page.RegisterStartupScript("CLOSE", "<script language="'javascript'">window.opener.location.href = window.opener.location.href;self.close();</script>");
Page.RegisterStartupScript("CLOSE", "<script language="'javascript'">window.opener.history.go(0) = window.opener.location.href;self.close()</script>");
These three doesnt work the way I want. They either popup the popup window again, or close the popup, reload the parent but then parent goes back to Viewstate's active viewindex 1 instead of staying in 3.
Any ideas how can I fix this? Thanks