Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Close current tab
Message
 
 
À
Tous
Information générale
Forum:
Javascript
Catégorie:
Autre
Titre:
Close current tab
Divers
Thread ID:
01588106
Message ID:
01588106
Vues:
37
After googling and reading tons of pages I can't find the solution to the following challenge. I need to close current tab (in the C# code of a page). The best solution I found is the following:
 Response.Write("<script language='javascript'> { window.close(); }</script>");
The only issue is that the Browser asks "The web page you are viewing is trying to close the tab. Do you want to close the tab." I would like to find a way to NOT show this message but simply close the tab. Is it possible? If you know, how?

UPDATE: Found solution:
Response.Write("<script language='javascript'> { window.open(window.location,'_self').close(); }</script>");
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Répondre
Fil
Voir

Click here to load this message in the networking platform