1
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") }
            });
        });

VB.NET(网络方法)

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

Hata verip duruyor lütfen bir yardımcı olun arkadaşlar 错误在哪里???

4

1 回答 1

0

从此脚本中使用:

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") }
            });
        });
于 2013-10-26T12:11:08.587 回答