开发者

calling web service through java script in mvc3

I made one web service, and try to call it with Java script, I found error of unknown method "ServiceImage". This is the following code snap of JScipt

<script language="javascript" type="text/javascript">
    ServiceImage.GetImageContract开发者_如何学编程(Txt, imageName, function (imgbol) {if (imgbol == true) ......    
</script>

` I am using the following code also

<asp:ScriptManager ID="ScriptManager1" runat="server" >


With ASP.NET MVC its probably easiest and arguably preferred to call a web service with jQuery like this:

(no paramerers passed or REST based web service)

$.get('ajax/test.html', function(data) {
  $('.result').html(data);
  alert('Load was performed.');
});

(with parameters)

$.post("test.php", { name: "John", time: "2pm" }, function(data) {
   $('.result').html(data);
   alert("Data Loaded: " + data);
});

Here's more information on jQuery ajax API jQuery Ajax API

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜