ASP.NET AJAX / scriptmanager problem

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
 
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.

Sorry, that should be "no script at all"
 
S

Showjumper

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,
 
J

JimL

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top