Click here to Skip to main content
Rate this: bad
good
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
good
Please Sign up or sign in to vote.

Solution 1

set following function on your body tag

 
 

 
<body onbeforeunload="return returTime()">
</body>
 
and add a javascript function on your page
 
 
function returTime()
{
var closeTime;//assign this variable with jQuery Clock

 window.returnValue=closeTime
 
}
 
  Permalink  
Comments
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 Maciej Los 225
1 Manfred R. Bihy 190
2 CHill60 180
3 _Amy 155
4 OriginalGriff 150
0 OriginalGriff 7,320
1 Sergey Alexandrovich Kryukov 6,043
2 Maciej Los 3,754
3 Peter Leow 3,448
4 CHill60 2,572


Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 29 May 2012
Copyright © CodeProject, 1999-2014
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