如何从asp.net中的代码关闭当前选项卡 [英] How to close current tab from code behind in asp.net

查看:80
本文介绍了如何从asp.net中的代码关闭当前选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨frnds,



如何从asp.net中的代码关闭当前选项卡



我已经搜索了但是我没有得到怎么做..



如果我在按钮中使用下面的代码点击窗口没有关闭,如果我写这个代码页面加载它的工作..

 Response.Write( < script language ='javascript'> {window.close();}< / script>); 





我的要求是在从后面的代码点击按钮后关闭窗口请告诉我们怎么做..

谢谢

mani ..

解决方案

参考 - 单击asp.net按钮时Html窗口的接近程度如何? [ ^ ]。

 受保护  void  ContineButton_Click( object  sender,EventArgs e)
{
this .ClientScript.RegisterClientScriptBlock( this .GetType(), 关闭 window.close());
}


this.ClientScript.RegisterClientScriptBlock(this.GetType(),Close,window.close(),true);

Hi frnds,

How to close current tab from code behind in asp.net

I have searched but i am not getting how to do ..

If i use the below code in button click the window is not closing , if i write this code in page load its working ..

Response.Write("<script language='javascript'> { window.close(); }</script>");



My requirement is to close the window after button click from code behind Please tell me guys how to do ..
thanks
mani..

解决方案

Refer - How close Html window when click asp.net button?[^].

protected void ContineButton_Click(object sender, EventArgs e)
{
    this.ClientScript.RegisterClientScriptBlock(this.GetType(), "Close", "window.close()", true);
}


this.ClientScript.RegisterClientScriptBlock(this.GetType(), "Close", "window.close()", true);


这篇关于如何从asp.net中的代码关闭当前选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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