window.onbeforeunload = function () {
var val = false;
$.ajax({
type: "POST",
url: sServiceURL + "/checkRecordsStatus",
async: false,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
if (msg.d == true) {
val = true;
};
}
});
if (val == true) {
return 'Turite neišsaugotų testavimo įrašų!';
}
};
Protected Sub Page_PreRender(sender As Object, e As EventArgs) Handles Me.PreRender
ScriptManager.RegisterStartupScript(Me, Me.GetType, "Service", "sServiceURL='" & VirtualPathUtility.ToAbsolute("~/ServicesPath.asmx") & "';", True)
End Sub
Komentarų nėra:
Rašyti komentarą