Geeks With Blogs
Gaurav Taneja Great dreams... never even get out of the box. It takes an uncommon amount of guts to put your dreams on the line, to hold them up and say, "How good or how bad am I?" That's where courage comes in.

Well while implementing Ajax i had received error due to Sys.WebForms.PageRequestManagerParserErrorException

the best solution that i could figure out to over come is catch this exception and byPass it.. if any body has a good way of catching this exception why this arise Please do let me know.

i has to modify the script

<script type="text/javascript">
                                        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function (sender, args)
                                        {
                                          
                                             if (args.get_error()!=null)
                                             {
                                                                                        
                                                 if (args.get_error().name === 'Sys.WebForms.PageRequestManagerParserErrorException')
                                                 {
                                                   
                                                    // remember to set errorHandled = true to keep from getting a popup from the AJAX library itself
                                                    args.set_errorHandled(true);
                                                     window.location.href='Login.aspx?Message=SessionExpired';
                                                }                                                
                                                 if ( args.get_error().name === 'Sys.WebForms.PageRequestManagerTimeoutException')
                                                {
                                                  
                                                    // remember to set errorHandled = true to keep from getting a popup from the AJAX library itself
                                                    args.set_errorHandled(true);
                                                    window.location.href='Login.aspx?Message=SessionExpired';
                                                }
                                             
                                             }
                                         }
                                         );
                                     </script>

Posted on Wednesday, April 16, 2008 10:50 PM .Net | Back to top


Comments on this post: Fix for Sys.WebForms.PageRequestManagerParserErrorException + Ajax

# re: Sys.WebForms.PageRequestManagerParserErrorException + Ajax
Requesting Gravatar...
Great! Thanks for your code.
That works very good.


Left by Stéphane D. on Dec 01, 2008 3:50 AM

# re: Sys.WebForms.PageRequestManagerParserErrorException + Ajax
Requesting Gravatar...
Great ! I used that script on my page. its working man ! thanks for your efforts!
Left by Muhammad Nadir Siddiqui on Feb 27, 2009 3:16 AM

# re: Sys.WebForms.PageRequestManagerParserErrorException + Ajax
Requesting Gravatar...
Great code man!!! but in my case i dont want to redirect to login page, instead, I send a second click to the button, and this time, everything works fine. Thnx!!!
Left by RadAmant0 on Aug 31, 2009 2:03 PM

# re: Fix for Sys.WebForms.PageRequestManagerParserErrorException + Ajax
Requesting Gravatar...
Thanks! Solved an irritating error message for me!!
Left by PAX on Oct 03, 2010 10:03 PM

# re: Fix for Sys.WebForms.PageRequestManagerParserErrorException + Ajax
Requesting Gravatar...
I know this a old thread. But I am facing the similar issue now. This javascript helped me to catch the error. But As RadAmant0 said I need to send a second click and continue with the event. Can you please share the code with me for the second click.
Left by Krish on Jun 08, 2012 3:51 AM

Your comment:
 (will show your gravatar)


Copyright © Gaurav Taneja | Powered by: GeeksWithBlogs.net