24 August 2008

Reload/Refresh parent window from pop up window (dialog window)

Let say you have a parent window with some information loaded from database, and then you have a link that will prompt a new dialog window base on the selection item on parent window. After you finished editing the data in dialog window, you click save then close. BUT… at the same time you also want parent window to auto refresh in order to show the realtime information/changes you have made. You can achieve this by many methods; AJAX..javascript..codebehind.. In my opinion, I think javascript is the easiest way to achive this. Just fire this javascript function on your dialog window’s close button. Thats all you need to do Just give me a thumb if really help you.
function ReloadParentWindow()
{
if (window.opener && !window.opener.closed)
{
window.opener.location.reload();
self.close();
}
}

0 comments :

Post a Comment