By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,547 Members | 1,075 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,547 IT Pros & Developers. It's quick & easy.

Second Child window to open on top of Parent window

P: 1

I am using 2012. (C# AS CODE BEHIND)

I have a parent window (ParentMain.aspx), I was able to open a new window (SampleChild1.aspx) from the parent window using below script on aspx.cs:
Expand|Select|Wrap|Line Numbers
  1. string strScript = string.Format("'/Sample.UI/SampleChild1.aspx','window','toolbar=no,hotkeys=no,location=no,directories=no,menubar=no,scrollbars=yes,status=1,resizable=0,width=600,height=500');");
  2. ScriptManager.RegisterStartupScript(this, this.GetType(), "nothing", strScript, true); 
After the SampleChild1.aspx is opened, now I have two windows open
  1. ParentMain.aspx
  2. SampleChild1.aspx
Whenever I click the samplechild1.aspx link, it open up samplechild1 window. No issues.

I want the below flow to work.
From samplechild1.aspx, I have to open samplechild2.aspx from aspx page and this samplechild2.aspx should not open as a another new window or on top of samplechild1.aspx, it should open on the top of ParentMain.aspx page

Please tell how to set the samplechild1.aspx open on ParentMain.aspx.

Kindly provide a solution at the earliest.

Oct 18 '13 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 9,731
This is actually a JavaScript question.
You can use the window.opener property to access the main window. From there you can call JavaScript functions and that can open the "child2" page within the main window.

I'm not sure, but you may lose access to your opener property once you change the page. I have moved your question to the JavaScript forum so that the experts there can give you more insight.

Oct 23 '13 #2

Post your reply

Sign in to post your reply or Sign up for a free account.