Updatepanel not working in upgraded webproject
I am working with an old web application originally developed in VB.NET 1.1. The application is now converted to the 4.0 framework and I wanted to use AJAX and the UpdatePanel. However I cannot get the UpdatePanel to work as expected. The page still does a full postback and not a partial postback as I would like it to do. If I do the same in a new application (not one converted from 1.1) it all works fine. I cannot find anything different between the two pages in terms of code and codebehind or references, obviously I am missing something. In the generated HTML for the two pages I do find differences, the page in the converted application for example doe开发者_如何学Cs not have the following:
<script type="text/javascript">
//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('ScriptManager1', 'form1',['tUpdatePanel1','UpdatePanel1'], [], [], 90, '');
//]]>
Does anyone know what I am missing?
I had the same problem and resolved comparing the web.config of the two web application. One thing making update panels not to work, was the xhtmlConformanceMode
setting. You can't use Legacy mode.
Though this is not your answer, but a very strong recommendation (a friendly advice):
Avoid UpdatePanels, please!
find another way to bring your application to AJAX. Be sure that you will pay the cost at last (my experience), so pay it now.
精彩评论