Friday, February 29, 2008

IE may shows "Unspecified error" after clicking on Cancel button of when navigate away from unsaved page

You may encounter "Unspecified error" message throws by IE after you click on Cancel button , when IE warns that you navigate away from an unsaved page. This error happens in both IE 6 and IE 7. Solution to this problem is to put handle the error and prevent them to show on user's browser. Put this codes below into your .aspx page.


window.onerror = UnspecifiedErrorHandler;

function UnspecifiedErrorHandler()

{return true;}