Code Snip "Customizing ScriptManager" to detect errors

written by Al on Monday, March 26 2007

 Quick code snip that you should add to your script manager if you are using AJAX to catch errors, something pretty frequent when using the ajax library.

aspx.cs:

 protected void ScriptManager1_AsyncPostBackError(object sender, AsyncPostBackErrorEventArgs e)
    {
        ScriptManager1.AsyncPostBackErrorMessage = e.Exception.Message+e.Exception.StackTrace ;
    }

aspx:

<asp:ScriptManager ID="ScriptManager1" runat="server"
            OnAsyncPostBackError="ScriptManager1_AsyncPostBackError">
            </asp:ScriptManager>


There are many customizations on the ScriptManager.
 

Similar Posts

  1. New ASP.NET AJAX
  2. Code Snip "AJAX Timer"
  3. Javascript communication to Silverlight 2.0

Comments

  • Dharma on on 4.24.2008 at 7:19 AM

    Dharma avatar

    hi ,

    thanks for ur solution, i got head ache with that error,am very greatfull and thankful to u

    Regards,

    dharma

  • Monty on on 5.16.2008 at 1:07 AM

    Monty avatar

    After adding that code, it just hid my error. Thought it would detect something?

  • Musa Bhai on on 7.07.2008 at 4:33 AM

    Musa Bhai avatar

    enableEventValidation="False"

    Adding this it doesn't make any diff.

    My actual problem is in Login window. If the Login or password entered wrong it shows the appr. message and allows to enter again, but entering again and click on login gives this error.

    "Sys.WebForms.PageRequestManagerParserErrorException"

Comments are closed

Options:

Size

Colors