如何关闭在服务器端按钮当前选项卡中单击? [英] How to close the current tab in the server side button click?

查看:182
本文介绍了如何关闭在服务器端按钮当前选项卡中单击?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图确认后关闭我目前的标签,所以我把下面的code。在我的确认键的结束,但该选项卡不收!


 字符串的JScript =<脚本> close_window();< / SCRIPT>中;
   ClientScript.RegisterClientScriptBlock(this.GetType(),keyClientBlock的Jscript);


解决方案

如果你想关闭当前窗口,你可以试试这个:

 字符串的JScript =<脚本> window.close()的;< / SCRIPT>中;
ClientScript.RegisterClientScriptBlock(this.GetType(),keyClientBlock的Jscript);

I try to close my current tab after confirm so i put the following code at the end of my confirm button , but the tab doesn't close !


   string jScript = "<script>close_window();</script>";
   ClientScript.RegisterClientScriptBlock(this.GetType(), "keyClientBlock", jScript); 

解决方案

If you want to close the current window, you could try this:

string jScript = "<script>window.close();</script>";
ClientScript.RegisterClientScriptBlock(this.GetType(), "keyClientBlock", jScript);

这篇关于如何关闭在服务器端按钮当前选项卡中单击?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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