• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 414
  • Last Modified:

Displaying changes on parent window in ASP.NET

Hi everyone.

I have a web application that displays info on a Infragistics ultrawebgrid control.
When you click on one of the details, it opens a new browser window to display all the detail in a form, so I can modify it or add a new record. This second window does not necesarly must be closed after adding each record. My question is: is there a way to update the first window (with the grid) each time that I save a record on the second?  I mean, adding records in one window browser, and displaying the changes on the other?

Thanks in advance
0
xigtechnomind
Asked:
xigtechnomind
  • 2
  • 2
1 Solution
 
OMC2000Commented:
You could do it client side accessing parent window using javascript.
You can either call javascript method registered in the parent window or directly update object properties in the parent window or just make it to reload:

function refreshOpener(refreshFromServer)
{
   if ( !window.opener || window.opener.closed )
     return;
   if ( refreshFromServer ) {
   // if you want to refresh opener content with data from the server:  
     window.opener.document.location = window.opener.document.location;
   } else {
// if you want to assign some field values from popup to opener
     if( window.opener.document.forms.opener_form_name.field_name )
       window.opener.document.forms.opener_form_name.field_name1.value = window.document.forms.popup_form_name.field_name2.value;
   }
}


//call parent window function:

window.opener.Build(window.document.forms.popup_form_name.field_name2.value);
0
 
xigtechnomindAuthor Commented:
so, If I want to reload the parent page from the popup I only need the following function on the popup?

function refreshOpener(refreshFromServer)
{
   if ( !window.opener || window.opener.closed )
     return;
   if ( refreshFromServer ) {
   // if you want to refresh opener content with data from the server:  
     window.opener.document.location = window.opener.document.location;
   }
}

And I must call that function each time that I save a record on the popup, right?

Thanks again
0
 
OMC2000Commented:
yes
0
 
xigtechnomindAuthor Commented:
Thanks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now