This is a migrated thread and some comments may be shown as answers.

URL Rewriting and PageRequestManagerServerErrorException

1 Answer 30 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dave Miller
Top achievements
Rank 2
Dave Miller asked on 03 Oct 2008, 05:38 PM
This is not a question but I am sharing a possible solution on the "PageRequestManagerServerErrorException" when performing url rewriting with AJAX.

I use RadControls exstensivelly in designing sites and have been running into this error with some of the new controls. Although the controls always work fine in the main form, I use a lot of dynamically loaded usercontrols containing RadControls and it is these that sometimes generate the error. I also do url rewriting on the main page and use a custom url rewrite form such as the one found here http://blog.angrypets.com/2007/01/aspnet_ajax_and.html.

I have spent a day trying to fix this error with the new version of RadScheduler in a usercontrol. While it worked fine on my dev machine it generated the error when published to the live server. It seems the problem is caused by a change to the action attribute in the form after the postback. using the javascript found here http://forums.asp.net/t/1268230.aspx to the user control fixed the error.

<script   language="javascript"   type="text/javascript">     
          Sys.Application.add_load(function()     
          {     
            var   form   =   Sys.WebForms.PageRequestManager.getInstance()._form;     
            formform._initialAction   =   form.action   =   window.location.href;     
          });     
  </script>   
 

I think this may also work in other senarios with the "PageRequestManagerServerErrorException" error.

I hope someone may find it useful.

Regards,
Dave

1 Answer, 1 is accepted

Sort by
0
Todd Anglin
Top achievements
Rank 2
answered on 06 Oct 2008, 06:31 PM
Thanks for the tip, Dave! I'm sure it will be helpful for others that search the forums. Glad you were able to find the workaround, too!

-Todd
Tags
General Discussions
Asked by
Dave Miller
Top achievements
Rank 2
Answers by
Todd Anglin
Top achievements
Rank 2
Share this question
or