如何使用代码文件关闭asp.net网页。 [英] how to close a asp.net webpage using code file.
本文介绍了如何使用代码文件关闭asp.net网页。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
请帮助如何使用代码文件关闭asp.net网页。
hi all,
Please help how to close a asp.net webpage using code file.
推荐答案
System.Web.HttpContext.Current.Response.Write("<script>self.close();</script>");
或
or
Page.RegisterStartupScript("close", "<script>self.close();</script>");
添加了预标记[/ EDIT]
Added Pre Tag[/EDIT]
请在后面的代码中添加以下行:
Please add below line in your code behind:
Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "ClosePage", "window.close();", true);
请尝试....
并抱歉prevoius soln。
Please try ....
and sorry for the prevoius soln.
这篇关于如何使用代码文件关闭asp.net网页。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文