Control parent window from Popup window


I open a popup window by clicking a button in a form. I want that, as soon as the popup window is closed the parent window should navigate to a another page.


Be nice to geeks, you might end up working for one

Please hit "MARK AS ANSWER" if I made you smile today ;)
11/8/2006 5:05:21 PM 93655 articles. 5 followers. Follow

3 Replies

Similar Articles

[PageSpeed] 56

To access the parent you can use "opener".

opener.document.location.href = '';

Shane Bauer

11/8/2006 6:41:44 PM


the parent window:

  <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick ="PopupWindow()"/>

 <script type ="text/javascript" > 
     function PopupWindow()
 ("popup1.aspx", "mywindow","location=1,status=1,scrollbars=1,width=400,height=400")    


the poput window:

  <asp:Button ID="Button1" runat="server" OnClientClick ="close()" Text="Button" /></div>

 <script type ="text/javascript" >
    function close()
        window.close ();

11/9/2006 1:56:07 AM

Thanks jessjing!! Your code didn't work on the first run but after some trial and error I found that the name of the javascript function in the popup page was the bug. You used the name "close()". We have to use a different name I guess( dont ask me why ). So, here's the final code for other forum members:

Parent Page Code:


1    <body>
2       <form id="form1" runat="server">
3         <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick='"Test2.aspx","Questions", "status=1, width=800, height=400, top=100, left=300")' />
4       </form>
5    </body>

Popup Window:


1    <body>
2       <form id="form1" runat="server">
3         <asp:Button ID="Button1" runat="server" OnClientClick ='closePopup()' Text="Button" OnClick="Button1_Click" />
4         <script type ="text/javascript" >
5               function closePopup()
6               {
7                   opener.document.location.href="Login.aspx";
8                   window.close();
9               }
10        </script>
11      </form>
12   </body>
Be nice to geeks, you might end up working for one

Please hit "MARK AS ANSWER" if I made you smile today ;)
11/9/2006 10:40:01 AM

Similar Artilces:

How to pass a web controll from child window to parent window.
Hi, there, I used javascript fuction ) to open a child window. In the child window, I have a FileUpload controll to browse a file that will be uploaded to the server in the parent window. In the parent window, I have a event handler to upload the file coming from FileUpload controll of the child window. How can I pass the FileUpload controll from the child window to the parent window? Thanks, Jack Won't work. The page with the control has to do the upload. NC...  ...

.Net Windows Control in Web Form
Hi all,How can I use a .Net windows control in a web form? I use object tag but it doesn't work and displays empty.Thanks in advance cheers Hi, you can check this article out: Hosting a Windows Control in a Web Form. This shows only how to host the control. If you want interaction with the client you can do this by setting the correct CAS (Code Access Security) settings on the client pc. Grz, Kris.Read my blog. Handy Firefox plugins for web developers.Workaround for non working Mark as answer buttons. Thanks guys for your replycheers...

how to referesh the parent window control without post back by popup window....
 hi,  I have a pop-up window that comes up when a user click on a HyperLinkColumn in a datagrid. On the pop-up, the user will edit a record at this point and hit the server side "submit" button. At that point, I would like to close the pop-up and refresh the parent window datagrid control without post back. I am using the javascript and asp.net2.0 with  Does anyone have examples on how to do this?   Thanks & regards    Amit RegardsAmit SaxenaSr. Software Developer try window.opener.location.href = window.opener.locatio...

Popup Window + Redirect Parent Window + Bind Child Window Data
I wish to achive something as below:1. Popup a child window Child1 from parent window Parent1 (Done)2. Click a button on Child1, redirect the Parent1 to Parent2 (Done)3. In Parent2, I want to bind the labels with the data from Child1 labels.4. Close the Child1 (Done)How can i achieve for Task 3???? Willing for your answers.. -- Tough People Do Tough Task -- Name Child1 when you open the window:"{Your URL}", "Child1", "{Your window options}"); Get a reference to Child1 from Parent2: var winRef ="", "Child1", ""); Use the reference to call a javascript metho...

Getting values from popup window and setting it to controls on page in the parent browser window..How ? Help
Here's what I was doing: 1) Form " frm1.aspx" contains  of "TEXT-BOX",and is already open. On click of a link button on "frm1.aspx" , a popup window appaers(using javascript) in which " frm2.aspx" is Loaded . 2) In the pop-up window ("frm2.aspx" ),I select a value populated in a List box and after selecting, clicked "OK" (server) button. 3) In btnOK_Click event I stored the selected value in Session and Closed the PopUp window using window.Close() and re-directed to "frm1.aspx". 4) I wanted to put this value ,in Session, i...

windows forms in vb .net into web forms
we are creating a database driven website as part of our project. currently we have forms connecting to the database created in visual basic. these windows forms we need to convert into web forms which are asp .net compatible. can u give me an answer or show me a way. Hi, because of the difference in nature between web and win applications you'll need to reimplement at least the UI part. If you have a multitiered application in which the busines logic and data access are in different parts/assemblies you can reuse them. Grz, Kris.Read my blog. Handy Firefox plugins for web developers.Wor...

add window form control on web form
i want to add windows from control link label on web from .what should i do?  saurabhiP:i want to add windows from control link label on web from . Windows form controls are for windows application and should not be used on web forms.You want a link label which is the same as a hyperlink in ASP.NET so use that instead.  saurabhiP:i want to add windows from control link label on web from .what should i do?  Hi saurabhiP,Base on my understanding, you want to use windows control to web form. But base on my experience, there are many issues! Check the following l...

Loading data from popup to parent window without refreshing the parent window.
Hi all, I have a requirement to pass data from a popup window to the parent window. There is an order entry screeen. The user has to select a customer before entering the order. On clicking the search customer button, a popup will open up where the user can do the search. The user will select a customer and the selected customer details should be passed back to the parent window without refreshing the parent window. How can this be accomplished? Kindly help me as this is a very urgent requirement. hello.- not really an ajax question. lots of examples out there that show this. here'...

Popup window values in parent window
 I have a linkButton on page1.aspx. On the OnClientClick Event of linkbutton i opens new window. Page2.aspx. On page2.aspx I have textbox and button contol. On the OnclientClick of Button in page2 i want textBox value into the parent page .TextBox. i have written following JavaScript. Please Help me. My Code is Here. In page1.aspx On ClientClick of LinkButton this Function calls. function newWin() {'page2.aspx','name','height=820,width=850'); } // Function to be called from Child Window function update(e...

To Close Popup Window from Parent window
Hai All, I have a Problem. I use; to open a new window when open button is Clicked from Parent Window. What i need is , i have another Button CLOSE in the Parent window.If i click the Close Button i need to close the Popup Window is any way to solve this Problem. Regards, Karthik.A you should open new window like this :; then you have an object named mywin that refers to new opened pop up menu. then this code must be runned to close it : mywin.close(); Good Luck A.K.S Hai AKS, I treid this tooooooo. But i cou...

reloading parent window from popup window
Hi, I am developing web application which open up in IE, in a page of the application i have a link to open a new IE window to give the results (using I have a link in the newly opened window, if user click that link, the current window should be closed and the first IE window should be reloaded or redirected to another address automatically. Like to use javascript. Is it possible? If so, please advice me. Many thanks, Renu          Hi, u may call this javascript while clicking the control in the popup window functio...

popup window to parent and parent to popup
HI I have parent window when i click the link in the parent window it will give me popup window and there some other links(code is below) in popup window. when i click them it has to go to parent window where should i write the code and what should i write <asp:DataList ID="dlTopTenResults" runat="server" Width="100%"> <ItemTemplate> <table > <tr> <div style ="border-bottom: 1px solid #E7E2B8; height:1px;"> <td width="7%" valign="middle"><span class="story_in_page_title"...

How to pass parameter from a popup window to its parent window?
I have a mailing.aspx page for emailing attachment. Since FulUpload control does not reveal the full path of the .jpg file on the client's computer, I am going to upload it to my web server first and then do the attachment that way. So for the upload, on the mailing.aspx page I have a btnAttachment button. When the user click on this btnAttachment button, a new window (fileUpload.aspx) popup for the user to upload the files. The problem I'm facing right now is, when the files are successfully uploaded to the ~/myUploads/ folder, how do I pass the file names of those files from the ...

Opening a popup window over the parent window with effects.
hi.... i am in a need to open a new popup window from the parent window on click of a tab control. this newely opened window should have the following behaviours. 1. it should not allow the main window to be active. only on close of this popup window the main window gets its access. 2. when the popup window appears it should give some diminishing effect on the parent window screen. 3. it should have a facility to comunicate with the parent window. 4. No third party controls and it will be good if the application work on both IE and Firefox.... i am using IE 6.0...  plz l...

Web resources about - Control parent window from Popup window -

Control - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Venezuela's Opposition Wins Control of Legislature - Al Jazeera America
... celebrate the closing of a polling station during legislative elections in Caracas, Venezuela, Dec. 6, 2015. The opposition won control of the ...

The ACLU backs using the terror watch list for gun control, but only “with major reform”
... did say, through a spokesperson, that the watch list would need “major reforms” in order to be used as an effective tool for gun control and ...

With gun control off-limits, politicians want tech sector to fight terror
... very next day, the Senate voted against a measure that would have barred gun sales to people on federal terror watchlists. Another gun-control ...

Obama calls for better gun control, and for tech companies to help fight terrorism
President Barack Obama all but called out encryption in a 15-minute Address to the Nation speech on Sunday night. The President touched on various ...

Obama speaks on ISIS, gun control, tolerance in Oval Office address - Videos - CBS News
In a primetime speech Sunday night, President Obama said the terror attack in San Bernardino, California, shows terrorism is now in a new phase. ...

Sugr Cube is a Sweet Spotify Speaker with Touch & Motion Control
... goodies, like Spotify Connect, Pandora, and, eventually, Air Play integration. Sugr also had a little bit of fun with volume and track controls ...

Porsche To Mission E Control: We Are Clear For Launch!
... handling of a Porsche. The contrast seemed to start early cries of the Mission E being the next Tesla [&hellip Porsche To Mission E Control: ...

Windows 10 vs. OS X: Which gives sys admins more control?
Nearly everything can be managed as if it were a mobile device, using APIs at the operating system for assured reach and consistent implementation ...

NV's Fiore: 'That 5 Year Old Grandson Of Mine Has Total Trigger Control'
It's very likely you've seen Michele Fiore's family Christmas photo by now, it's been all the rage at Idiocracy viewing parties everywhere. If ...

Resources last updated: 12/8/2015 11:14:06 PM