I have a LinkButton
called \"Exit Chat\" on the view.I embed javascript
code into OnClientClink=javascript:confirm(\'Are you sure you want to end
You can check the result of the confirm and then close the window if true.
<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False"
CommandName="Delete" Text="Delete"
OnClientClick="return showConfirm();">
</asp:LinkButton>
<script>
function showConfirm()
{
var ok = confirm('Are you certain you want to delete this product?');
if (ok)
{
window.close();
}
}
<script>