如何使用C#检测活动窗口 [英] how to detect active window using C#

查看:116
本文介绍了如何使用C#检测活动窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



i有一个asp.net页面,我用fancyBox调用另一个页面。



FancyBox

Hi guys,

i have a asp.net page where i'm invoking another page using fancyBox.

FancyBox

<script type="text/javascript">
       $(document).ready(function () {
           $(".Display").fancybox({
               'padding': 0,
               'width': 600,
               'height': 200,
               'autoScale': true,
               'transitionIn': 'none',
               'transitionOut': 'none',
               'type': 'iframe',
               'scrolling': 'no',
               'hideOnOverlayClick': false,
               'showCloseButton': true
           });
       });
   </script>

<a class="Display" href='<%# String.Format("UpdateDifferences.aspx?RegNo={0}&Status={1}&FileDate={2}", Eval("RegNo") , Eval("Status") , Eval("File_Date")) %>'><asp:ImageButton ID="imgView" Visible="true" runat="server"
                       ToolTip="Edit" ImageUrl="~/images/Edit.png"
                       Width="20" Height="20" />  
                     </a>







from PageA Invoking PageB(fancybox) 1s update is done i want to close the PageB(fancybox), once pageB is closed automatically PageA will get active, on 
active i want to refresh the pageA.





1)更新完成后如何关闭花式框。

2)如何在页面激活时刷新页面。



可以有人请帮助我。



谢谢



1) how to close the fancy box once update is done.
2) how to refresh the page when its get active.

can anyone please help me.

Thanks

推荐答案

(文件).ready(function(){
(document).ready(function () {


(。Display)。fancybox({
'padding':0,
'width':600,
'height':200,
'autoScale':true,
'transitionIn':'none',
'transitionOut':'none',
'type':'iframe',
'scrolling':'no',
'hideOnOverlayClick':false,
'showCloseButton':true
});
});
< / script>

< a class =Displayhref ='<%#String.Format(UpdateDifferences.aspx?RegNo = {0}& Status = {1}& FileDate = {2 },Eval(RegNo),Eval(Status),Eval(File_Date))%>'>< asp:ImageButton ID =imgViewVisible =truerunat =server
ToolTip =编辑ImageUrl =〜/ images / Edit.png
宽度=20高度=20/>  
< / a>
(".Display").fancybox({ 'padding': 0, 'width': 600, 'height': 200, 'autoScale': true, 'transitionIn': 'none', 'transitionOut': 'none', 'type': 'iframe', 'scrolling': 'no', 'hideOnOverlayClick': false, 'showCloseButton': true }); }); </script> <a class="Display" href='<%# String.Format("UpdateDifferences.aspx?RegNo={0}&Status={1}&FileDate={2}", Eval("RegNo") , Eval("Status") , Eval("File_Date")) %>'><asp:ImageButton ID="imgView" Visible="true" runat="server" ToolTip="Edit" ImageUrl="~/images/Edit.png" Width="20" Height="20" />   </a>







from PageA Invoking PageB(fancybox) 1s update is done i want to close the PageB(fancybox), once pageB is closed automatically PageA will get active, on 
active i want to refresh the pageA.





1)更新完成后如何关闭花式框。

2)如何在页面激活时刷新页面。



可以有人请帮助我。



谢谢



1) how to close the fancy box once update is done.
2) how to refresh the page when its get active.

can anyone please help me.

Thanks


当你工作时,没有这样的东西'活跃'/'不活跃'浏览器中的网页。激活的是托管您页面的Web浏览器窗口,但您的页面上没有任何事件...

您可以使用PageB的opener属性在PageA上调用刷新功能...

https://developer.mozilla.org /en-US/docs/Web/API/Window.opener [ ^ ]
There is no such thing 'active'/'inactive' when you are working with web pages inside a browser. What get activated is the web browser window hosting your page, but your page get no events on that...
What you can do is use the opener property of your PageB to call a refresh function on PageA...
https://developer.mozilla.org/en-US/docs/Web/API/Window.opener[^]


这篇关于如何使用C#检测活动窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆