Updated ASP.NET 3.5 to 4.0 -> Sys.WebForms.PageRequestManager is undefined

ε祈祈猫儿з 提交于 2019-12-04 08:31:18
jmoon

I was having trouble with this recently as I was updating an older project and followed your steps above but it was still giving me the same error. I found that I needed to update a line in the web.config file which fixed it.

I changed:

<xhtmlConformance mode="Legacy"/>

to:

<xhtmlConformance mode="Transitional"/>

Set EnablePartialRendering="false" in ScriptManager

... and I've solved it myself by replacing the UpdatePanels and by removing the scripting managers.

I know this post is very old but the way I solved this problem its not given here.. So I thought its not bad to add one more way. I tried doing

Set EnablePartialRendering="false" in ScriptManager

and it worked but then for every click the page was getting fully loaded which I didnt wanted. so What I did is I just added a Line in Page_Load(). btnexport is button id.

ScriptManager.GetCurrent(Page).RegisterPostBackControl(btnexport);

I first tried it outside postback but my requirements were to export even after every dropdown click which was in update panel so the button wasnt working for that. then when I put it inside postback... voila!! It worked like a charm. So, you can put it outside or inside postback according to your requirements.

OR

One more solution - You can do this-

You might have forgot to add trigger inside asp:updatepanel like me. Add this inside updatepanel and voila!!

<Triggers>
      <asp:PostBackTrigger ControlID="btnexport" />
</Triggers>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!