Tuesday, March 20, 2007

UpdatePanel still performing full postback

Had some fun tracking this one down today, fortunately someone else had already done the hard work in working out how to fix it.

Essentially I was trying out a basic AJAX page in an existing 2.0 web application project. The various additional required sections were added to the web.config and I followed the Introduction to the UpdatePanel control, where a label is updated when you click a button.

Simple. Or so you'd think. No AJAX behaviour for me - it was performing a full postback.

Fortunately I managed to find a post from "Rick" that explained what the culprit was - the <xhtmlConformance mode="Legacy"/> in the web.config. Commenting this out gives the desired behaviour.

I must admit I haven't bothered investigating any further to work out why that works - feel free to let me know.

Found another post about this that explains a bit more from Scott Guthrie.

No comments: