1
에서 작업 (방해 할 수있는) 모든 스크립트를 제거하고이를 추가하지 않습니다 :onbeforeunload는 비주얼 스튜디오 2013에서 웹 프로젝트를 만듭니다 비주얼 스튜디오 2013
<script type="text/javascript" src="~/Scripts/jquery-1.8.2.min.js"></script> <!-- Note that the version might be different -->
<script type="text/javascript">
jQuery(window).bind('beforeunload', function (e) {
var message = "Why are you leaving?";
e.returnValue = message;
return message;
});
</script>
onbeforeunload
이벤트가 발생하지 않습니다. 그러나 Visual Studio 2012에서이 도구를 열면 Visual Studio 2012에서 열려면 ASP.NET MVC 5
을 사용하지 않아야합니다.