ASP.NET AJAX PageMethods call load whole page for .NET 4.5 IIS 7.5

╄→гoц情女王★ 提交于 2019-12-05 15:04:42

If you are using friendly urls, then add

PageMethods.set_path(PageMethods.get_path() + '.aspx');

to your js

Good luck!

Friendly URLs (the extensionless URL library that's part of the default project template) doesn't support invocation of [WebMethod] routines. If you must use [WebMethod], uninstall Friendly URLs from the project. This can be done from the Nuget Package Manager window.

Once you remove this package, you may need to fix links in your project and in your Web.config file to add back the missing .aspx extensions.

yes, it seems to be web.config setting.

try removing this line from <modules> section <remove name="ScriptModule" />

just add

<system.webServer>
 <modules>
   <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
 </modules>
</system.webServer>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!