Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ASP.NETAJAX Post错误_Asp.net_Ajax_Vb.net_Jquery - Fatal编程技术网

ASP.NETAJAX Post错误

ASP.NETAJAX Post错误,asp.net,ajax,vb.net,jquery,Asp.net,Ajax,Vb.net,Jquery,VB.NET WebMethod jQuery $(".lnkpro").click(function () { $.ajax({ type: "POST", url: "uygulamalar.aspx/Getir", data: '{name: "1234"}', contentType: "application/json; charse

VB.NET WebMethod

jQuery
 $(".lnkpro").click(function () {
            $.ajax({
                type: "POST",
                url: "uygulamalar.aspx/Getir",
                data: '{name: "1234"}',
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (sonuc) { $(".resimler").html(sonuc.d); },
                error: function () { alert("error") }
            });
        });
他在阿卡达拉的花园里散步 错误在哪里?

使用此脚本:

  <System.Web.Services.WebMethod()> _
      Public Shared Function Getir(ByVal name As Integer) As String
        Return name & " asdalo"
      End Function

删除“{name:1234}”中的单引号,那么我恐怕不支持非英语使用者@Satya。我相信OP需要删除双引号,因为值被解释为string@YuriyRozhovetskiy,这不是应该是{name:1234}而不是{name:1234}吗?我做了,但问题没有解决
var data={
    name : 1234
};

$(".lnkpro").click(function () {
            $.ajax({
                type: "POST",
                url: "uygulamalar.aspx/Getir",
                data: JSON.stringify(data),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (sonuc) { $(".resimler").html(sonuc.d); },
                error: function () { alert("error") }
            });
        });