jQuery   发布时间:2022-03-30  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了jquery – PageMethod返回整个页面大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
@H_301_2@
您好我们使用 jquery发送ajax请求,但每次返回页面内容.
我们使用的是.NET Framework第2版

$.ajax({
type: "POST",url: "ajaxPage.aspx/testMethod",data: "{test:'test'}",contentType: "application/json; charset=utf-8",dataType: "json",success: function (result) {
    $("#span_result").html(result.d).fadeIn();
},error: function (msg) {
     $("#span_result").hide();
}
}); 

//ajaxPage.aspx.cs
[System.Web.services.WebMethod]
public static String testMethod(String test)
{
     return test;
}

解决方法

你在web.config中有这个吗?

<system.web>
  <httpR_617_11845@odules>
    <add name="ScriptModule" type="System.Web.Handlers.ScriptModule,System.Web.Extensions,Version=1.0.61025.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35"/>
  </httpR_617_11845@odules>
</system.web>
@H_301_2@

大佬总结

以上是大佬教程为你收集整理的jquery – PageMethod返回整个页面全部内容,希望文章能够帮你解决jquery – PageMethod返回整个页面所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。