Ok... I'm having a problem with Ajax. I don't know if here is the place to ask it, but here it goes... My site uses latest version of Ajax, and Framework 3.5 (c# language)... I am using script manager in the master page. Also the page gets refreshed async, using the Ajax timer control. The task is to hide all the Ajax error alert windows. I tried using the following methods: 1. setting the properties of the ScriptManager: - AllowCustomErrorsRedirect="false" - AsyncPostBackErrorMessage="" 2. Using the ScriptManager event OnAsyncPostBackError="ScriptManager1_AsyncPostBackError" 3. Using the EndRequest: Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequest); function endRequest(sender, e) { if(e.get_error()) { e._error.message = ""; e.set_errorHandled(true); } }
4. using the JavaScript window.onerror event The problem is that not all the errors are hidden, and also not always. For example... I have the following scenario: 1. Load the page in IE. 2. Go to page code and delete ";" after one line (create a compilation error). 3. Save the page and wait for the refresh async postback. - the end request event is fired, the original e._error.message is: "Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500."
- but the actual alert window that appears automatically has the following message: "An unhandled exception occurred during the execution of the current web request. Compilation error."
Also the script manager event OnAsyncPostBackError does not fire. Can someone give me a hand? Thanks, Valy.
Just call me Valy... :)