export function SetBeforeUnloadEventHandler(esInstance,metohdName) { window.addEventListener("beforeunload", function () { esInstance.invokeMethodAsync(metohdName); }); }