2012年3月26日月曜日

Response.Redirect doesnt work with AJAX Extensions Beta 1 (Atlas)

I was using the July Atlas CTP and I decided to give the new AJAX Extensions beta a try... now anytime I call Response.Redirect() when I handle an event for a control that is inside an UpdatePanel I get an error that says, "Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed." This happens regardless of whether I'm doing a partial postback or a regular postback as long as the control that caused the event is inside an UpdatePanel.

I found it odd that ScriptManager.IsInAsyncPostBack == true when I clicked a button that wasn't assigned to an AsyncPostBackTrigger... I'm assuming that that probably has something to do with why the Response.Redirect() didn't work. (Yes, I did verify that UpdatePanel.UpdateMode was set to Conditional.)

This is all fine with me I guess as long as there's another way to redirect to another page in server side code. Anyone know what I need to do?

Thanks,
Jon

Calling Response.Redirect() during an async post is supported. Make sure you have the ScriptModule on web.config for this work:

- Federico

  
 <httpModules> <add name="ScriptModule" type="Microsoft.Web.UI.ScriptModule, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </httpModules>

Right after I posted the original message I noticed that I had put the <httpModules> stuff in the wrong place. :)

0 件のコメント:

コメントを投稿