JavaScript PopUp window.

Posted on 2006-11-08
Last Modified: 2008-03-04
Dear Experts.

i am using ASp.Net2.0 C#
i have window and i want to open a new small window, when the user close this small window i want the parent window that called this small one to know, without postingBack the parent window, througth JavaScript.

thank you.
Question by:RamyBouchra
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 15

Expert Comment

ID: 17897450
What exactly are you trying to achieve?
LVL 12

Accepted Solution

renjurdevan earned 250 total points
ID: 17897490

call from client side script , ie if you want to open popup frm a button click

<input type="button" id= "test" onclick="open();">

function open()
{       (szURL,"mywindow","width=700,height=600,status=0,toolbar=0,scrollbars=0");

Here szURL = your url of the popup window. width, height  ,status... all are properties of the popup window.

and in popup window you can capture the onunload event of the body..

on onunload update a variable or hidden field in the parent window like

window.opener.GlobalVariable__Name = 1;

LVL 96

Expert Comment

by:Bob Learned
ID: 17897494
Sounds like to me.

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Assisted Solution

Niraj_Singh earned 250 total points
ID: 17897738

 hope the code below will be helpful to u...

Include this code on ur parent window

<input type=button"abc.aspx","Ratting","width=550,height=170,left=150,top=200,toolbar=0,status=0,");    
   value="Open Window">

On child window incude the code below....

<title>(Type a title for your page here)</title>

<SCRIPT language=JavaScript>
function win(){


<input type=button onClick="win();" value="Close this window">



Expert Comment

ID: 17900388
Are you trying to refresh parent window without postback when popup is closed ? then AJAX is the way to go.

Expert Comment

ID: 17902511

This can be done by adding a control (hidden html control, textbox control, lable control etc) on your parent page and on the Child window's function win(), assign value to that control as:

function win(){
window.opener.getElementById('txtname').value = "1";

This will assign a value '1' to the parent's page control without refreshing the it.


Expert Comment

ID: 17904388

Forgot to add .document. The function win() will be now:

function win(){
window.opener.document.getElementById('txtCtrlname').value = "1";

here 'txtCtrlname' is the name of the control  (I have used textbox) you have added.


Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Function after success of Jquery/AJAX action 9 46
Query in AngularJS 8 53 Will we ever be able to build mobile apps in it 6 33
Multi-Column Repeater 3 29
I have developed many web applications with asp & and to add and use a dropdownlist was always a very simple task, but with the new, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question