Click here to Skip to main content
16,021,041 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
XML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>XHTML Test : Close Current Window</title>
<script language = "JavaScript" type ="text/javascript"  >
            function closeMe()
            {
                if (navigator.appName != "Microsoft Internet Explorer") {
                netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite");
            }

            window.open('', '_self');
            window.close();

            }
    </script>
</head>
<body>
<table>
<td>
 <input id="btnClose" style="font-weight: bold;font-size: 11px;background-color:#104e8b;border-bottom-width:thin;color:White;" type="button" value="Close" onclick="javascript:closeMe();" />
</td>
</table>
</body>
</html>


above js function for close button is working html page but not in asp.net any one suggest any solution on that.
Posted

1 solution

There is no "HTML vs. ASP.NET". What you ask is the same as saying "Close a window works in my home's rooms, but not in Microsoft Windows".

From the client perspective, there is no ASP.NET. If this is an HTML page, a client cannot see any difference it is delivered from a static file on the server or from an ASP.NET program. Do the following: run your server, load your page in Web client and save the loaded page in a file on your local hard disk. Compare this file with the HTML file you show in your question — you will immediately see the difference.

—SA
 
Share this answer
 
Comments
Simon Bang Terkildsen 28-Sep-11 15:43pm    
Good suggestion
Sergey Alexandrovich Kryukov 28-Sep-11 15:56pm    
Thank you, Simon.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900