ASP.NET AJAX / scriptmanager problem

  • Thread starter Thread starter JimL
  • Start date Start date
J

JimL

Hi,

I've been given the job of "Ajaxifying" an existing application. If I
create a new test page in the application, Ajax works fine. However
when I add a scriptmanager and updatepanel to an existing page, it
doesn't work - the page just gets completely refreshed.

In each case, the Ajaxy parts of the .aspx file look identical, but
when I look at the HTML in the browser page, I find that in the
failing example, there is script at all for the scriptmanager.

Anyone suggest why this might be?

thanks,
Jim
 
Hi,

I've been given the job of "Ajaxifying" an existing application. If I
create a new test page in the application, Ajax works fine. However
when I add a scriptmanager and updatepanel to an existing page, it
doesn't work - the page just gets completely refreshed.

In each case, the Ajaxy parts of the .aspx file look identical, but
when I look at the HTML in the browser page, I find that in the
failing example, there is script at all for the scriptmanager.

Sorry, that should be "no script at all"
 
So what i can gather from your post is that you are not getting the partial
page updates with the UpdatePanel, correct?
Make sure you have EnablePartialRendering set to true, also i found if the
code behind method has the handles clause on it then the partial page
updates dont work - the whole page posts back,
 
So what i can gather from your post is that you are not getting the partial
page updates with the UpdatePanel, correct?
Make sure you have EnablePartialRendering set to true, also i found if the
code behind method has the handles clause on it then the partial page
updates dont work - the whole page posts back,

Thanks Showjumper, I've actually nailed it - the script wasn't being
rendered because the old web.config file has a tag :-

<xhtmlConformance mode="Legacy"/>

comment that out, and "voila" all the scripting starts to work. This
wasn't mentioned in any of the documentation I looked at about adding
AJAX to existing projects, and it really ought to be heavily flagged,
as all my updates of our config file were correct, and I've had to
binary chop my way through the damn thing to find this. Of course, now
if I Google for "xhtml legacy ajax" there are all the other poor
suckers who have suffered from this bug.

Cheers everyone,
Jim
 
Back
Top