window.close call is not working

451 Views Asked by At

The window.close() method is not working in Chrome.

A "close" button exists in my Layout page with the JavaScript close method:

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

<a  id="Close" href="javascript:window.open('', '_self','' );window.close();">Close</a>

When tried to call a controller method which returns the VIEW, on click of close button (which is in layout.cshtml) does not work. It throws an error:

Scripts may close only the windows that were opened by it.

This works correctly in cases like returning a partial view. IE has no issues.

0

There are 0 best solutions below