You must Sign In to post a response.
  • Category: ASP.NET

    Close current tab in button click in c#


    I want to close current tab in button click in c#. Here is my code,

    <script type="text/javascript">
    function down() {

    its working in chrome. But not working in mozilla firefox. Please help me!!!
  • #762961
    Hello Sudha,

    Try this code :

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

    I have used it in one of my project. Hope this will help you.

    Nirav Lalan
    DNS Gold Member
    "Failure is the path of least persistence"

  • #762985

    You may have to handle this separately.

    Please refer below article:

    Asheej T K
    Microsoft MVP[ASP.NET/IIS]
    DotNetSpider MVM

Sign In to post your comments