Aditya Chauhan

Aditya Chauhan

  • NA
  • 102
  • 55.7k

Not Able to Close browser tab

Mar 26 2015 2:23 PM
Hello Team i am just open a tab  with java script in c#
//here 
StringBuilder sb = new StringBuilder();
sb.Append("<script type = 'text/javascript'>");
sb.Append("window.open('");
sb.Append(url);
Session["url"] = url.ToString();
sb.Append("');");
sb.Append("</script>");
ClientScript.RegisterStartupScript(this.GetType(),
"script", sb.ToString());
//this is f9 perfactly ...
and i want to close the open tab(url) after 40 seconds  
how it possible
i am using
string jScript = "<script>window.close();</script>";
ClientScript.RegisterClientScriptBlock(this.GetType(), "btnsubmit", jScript);
//this work with btnsubmit on any other form
but here  is  not working ..
i am just want to perform it with timer event or any other option you have please suggest..

Answers (2)