Al final lo resolvi así:
Jquery
Código:
function logoutUser() {
$.ajax({
type: 'POST',
url: '<%= ResolveClientUrl("~/Logout.aspx") %>',
success: function (response) {
if (response == "done") {
window.location.href = '<%= ResolveClientUrl("~/Default.aspx") %>';
}
else {
alert("Sesión no cerrada");
}
},
error: function () {
alert("No ha sido posible desloguearse");
}
});
}
Code behind de Logout.aspx, logout.aspx está en blanco.
Código:
Public Class Logout
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Page.IsPostBack Then
Else
Dim msg As String = "done"
Try
Session.Abandon()
Catch ex As Exception
msg = "fail"
Finally
Response.Clear()
Response.Write(msg)
Response.End()
End Try
End If
End Sub
End Class