20,218 questions
Depends. Refer to the documentation for how browsers work here. Specifically, if you opened the window within your main app then you can use the .close
function of the window to close it in Javascript. You cannot do this from C# as that is server side code and server side code has no control over the client side.
var window = window.open('...');
...
window.close();
However this only works on windows you opened via JS. If the window was opened via the user (aka they opened a tab) then the client side code cannot close it.