0

the goal of this script is to only execute on page close when edited (a bool in ASP) is true

here is what the code looks like....

window.onbeforeunload = function (){
     if (<%=edited%>){  
         return 'Are you sure you want to leave?';  }

      };

how would i get this to work?

Ishey4
  • 327
  • 3
  • 13
  • How about using [`ClientScriptManager.RegisterClientScriptBlock`](http://msdn.microsoft.com/en-us/library/btf44dc9(v=vs.110).aspx) in code behind? – Uwe Keim Jan 27 '14 at 19:42
  • 1
    Similar post : http://stackoverflow.com/questions/21192343/how-do-i-tell-the-web-browser-that-the-user-has-modified-the-page/21192811#21192811 – Hannan Hossain Jan 27 '14 at 19:44

0 Answers0