Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Ajax error handlling

Ajax error handlling

Scheduled Pinned Locked Moved .NET (Core and Framework)
helpcsharpjavascriptsysadmintools
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    valerian precop
    wrote on last edited by
    #1

    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... :)

    P 1 Reply Last reply
    0
    • V valerian precop

      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... :)

      P Offline
      P Offline
      Patrick Kilgore
      wrote on last edited by
      #2

      you might have better luck posting this in the ASP.net/Web Development forum

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups