对话框关闭时从模态对话框返回的时间 [英] Return Time from the Modal Dialog when the Dialog is closed
问题描述
我正在从父网页中打开子模态对话框"窗口.用于打开对话框的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,");
}
Asp代码如下:-
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;" />
在我的"ClockPopUp.aspx"中,我仅使用了一个jquery秒表插件,该插件仅用于显示目的,除此外没有其他用途.我的要求是我希望用户关闭父页面上的ModalDialog,以便我们捕获弹出窗口将关闭的时间.否则ShowmodalDialog将在window.close()返回datetime.
请尝试解决此问题,因为它非常紧急,如果可能,请也共享代码段,而我在javascript中不太好.
谢谢您,并等待您的友好答复.
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.
推荐答案
在您的身体标签上设置以下功能
set following function on your body tag
<body onbeforeunload="return returTime()">
</body>
并在页面上添加javascript函数
and add a javascript function on your page
function returTime()
{
var closeTime;//assign this variable with jQuery Clock
window.returnValue=closeTime
}
这篇关于对话框关闭时从模态对话框返回的时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!