Click here to Skip to main content
11,711,750 members (79,084 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET Javascript
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 at 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
0 Sergey Alexandrovich Kryukov 434
1 CHill60 280
2 OriginalGriff 170
3 Peter Leow 130
4 Abhinav S 125
0 CHill60 280
1 Sergey Alexandrovich Kryukov 125
2 Andy Lanng 120
3 Abhinav S 95
4 Maciej Los 95

Advertise | Privacy | Mobile
Web02 | 2.8.150819.1 | Last Updated 29 May 2012
Copyright © CodeProject, 1999-2015
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