Second Child window to open on top of Parent window

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • UthraDT
    New Member
    • Oct 2013
    • 1

    Second Child window to open on top of Parent window

    Hi,

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

    I have a parent window (ParentMain.asp x), I was able to open a new window (SampleChild1.a spx) from the parent window using below script on aspx.cs:
    Code:
    string strScript = string.Format("window.open('/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');");
    ScriptManager.RegisterStartupScript(this, this.GetType(), "nothing", strScript, true);
    After the SampleChild1.as px is opened, now I have two windows open
    1. ParentMain.aspx
    2. SampleChild1.as px

    Whenever I click the samplechild1.as px link, it open up samplechild1 window. No issues.

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

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

    Kindly provide a solution at the earliest.

    Thanks,
    UTD
    Last edited by Frinavale; Oct 23 '13, 03:31 PM. Reason: Added code tags. Please post code in code tags.
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    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.

    -Frinny

    Comment

    Working...