Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6829787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:32:29+00:00 2026-05-26T22:32:29+00:00

I have a parent page and child page, both aspx. All is working, but

  • 0

I have a parent page and child page, both aspx. All is working, but now I would like to close child page, if user leaves child popup page and goes back to parent page and clicks on something else like page index of Gridview. I CANNOT close popup child page if user goes to another app, or some other location, I only want to close if something on parent page is changed.

I have the PageIndexChange Event set up for other purposes, I would just like to add some functionality, perhaps a script manager to close the child popup page if the Gridview index is changed, java or another way which ever works best.

I think I might also need to check if the child page is even open.

Any help and examples would be greatly appreciated.

EDITED: This is the code that opens the popup child page…

' Sets up popup to open when row selected for edit is cycled in DataRowBound event
    If IsPostBack Then
        If (e.Row.RowState And DataControlRowState.Edit) > 0 Then
            If Session("updateComplete") <> "Y" And Session("CancelUpdate") <> "Y" Then
                Dim BrowserSettings As String = "status=no,toolbar=no, scrollbars =yes,menubar=no,location=no,resizable=no," & "titlebar=no, addressbar=no, width=650, height=800"
                Dim URL As String = "pttStringPopUp.aspx"
                Dim scriptText1 As String = ("<script>javascript: var w = window.open('" & URL & "','_blank','" & BrowserSettings & "'); </script>")

                ScriptManager.RegisterStartupScript(Me, GetType(Page), "ClientScript1", scriptText1, False)
                Session("updateComplete") = "N"
            End If
        End If
    End If

Thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:32:30+00:00Added an answer on May 26, 2026 at 10:32 pm

    You can attach an onclick handler in the RowDataBound event, and in the event close the popup:

    protected void GridView1_RowDataBound(object sender, EventArgs e)
    {
        e.Row.Attributes["onclick"] = String.Format("rowClick({0});", e.Row.RowIndex); 
    }
    

    ASPX:

    var dialog;
    var selectedRowIndex;
    
    rowClick = function(rowIndex){
        if (selectedRowIndex){
            if (rowIndex != selectedRowIndex){ 
                selectedRowIndex = rowIndex;
                if (dialog){
                    dialog.close();
                }
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Parent page and a Child page('empW.cfm'),which is nothing but a popup window
I have two checkboxlists on a page - Parent and Child. Both are in
I have this script on my html page: <script language='javascript'>parent.resizeTo(550,510);</script> I'd like to add
The question sums it up really... I have a parent page with a child
I have a child browser window (aspx) opened from the parent application. The child
If you have a parent page - more like a canvas - with side
I have a page (parent) with an iFrame (child) embedded in it, the iFrame
I have one parent page with a parentManagedBean (attached to Session Scope). On click
I have a parent object called Page that has a List of objects called
I have a web page that consists of a checkbox (parent) and on this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.