Click here to Skip to main content
13,448,549 members (54,323 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I am opening a Child Modal Dialog window from my parent webpage.The javascript code for opening the Dialog is as follows:-
function openmodalWin() {
        window.showModalDialog("ClockPopUP.aspx", "Clock", "dialogWidth:550px;dialogHeight:350px,");

The Asp Code is as Follows:-
<asp:Button ID="Button1" runat="server" Text="Lunch" CausesValidation="false" CssClass="bigbuttons" style="background:url(../App_Themes/Images/green-box.gif)" Font-Bold="True"  ForeColor="White" Font-Size="Large" OnClientClick="openmodalWin(); return false;" /> 

In my "ClockPopUp.aspx" i had used only one jquery stop watch Plugin which is just for showing purpose and no use except it.My requirement is that i want that as the user will close the ModalDialog, on the parent page we can capture the time when the Pop up will be closed. or the ShowmodalDialog will return datetime at window.close().

please try to solve this issue as it is very urgent and if possible please share the code snippet also and i m not so good in javascript.
Thanks in advanse and waiting for all your's kind response.
Posted 29-May-12 0:30am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

set following function on your body tag

<body onbeforeunload="return returTime()">

and add a javascript function on your page

function returTime()
var closeTime;//assign this variable with jQuery Clock


Dharmenrda Kumar Singh 29-May-12 8:05am
Thanks, its working.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.180318.3 | Last Updated 29 May 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100