I want to close current tab from code behind as i want to perform some operation so after performing some operation it should be closed so please help me.. thanks in advance.
I tried it with
function close_window() {
if (confirm("Close Window?")) {
close();
}
}
but not able to call this method from code behind.
I want to close current tab from code behind as i want to perform some operation so after performing some operation it should be closed so please help me.. thanks in advance.
I tried it with
function close_window() {
if (confirm("Close Window?")) {
close();
}
}
but not able to call this method from code behind.
Share Improve this question edited Mar 5, 2012 at 10:19 svick 245k53 gold badges405 silver badges531 bronze badges asked Mar 5, 2012 at 10:16 milind talatimilind talati 131 silver badge3 bronze badges 02 Answers
Reset to default 4 string jScript;
jScript="<script>close_window();</script>";
ClientScript.RegisterClientScriptBlock(this.GetType(),"keyClientBlock", jScript);
I know this is an old thread, but I thought I would post what worked for me. Tested and working in .NET 3.5 & 4.0.
Response.Write("<script>window.close();</script>");