从MVC调用Web服务 [英] Calling Webservices from MVC

查看:69
本文介绍了从MVC调用Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

如何使用MVC应用程序中的Jquery通过API调用Webservices



谢谢与问候,
Soumya

Hi All,

How to call Webservices through an API using Jquery from an MVC application



Thanks & Regards,
Soumya

推荐答案

好吧,它与MVC无关,如果要使用JQuery调用Web服务,则可以使用
Well, its not that much related to MVC, if you want to use JQuery to call your web service you can use the


.ajax 方法(大量示例和使用该方法的链接),请记住,它将从客户端调用Web服务,无论您使用的是MVC还是MVC,它都与它无关. ASP.NET表单或任何它是您的Web应用程序.
.ajax method (tons of examples and links on using that), keep in mind that will call the web service from the client side and it has nothing to do whether you are using MVC or ASP.NET forms or whatever it is your web application.


我已经添加了以下代码行.但是它显示带有消息"undefined"的消息框


I have added Below lines of coding .but it display a messagebox with a message ''undefined''


<script type="text/javascript" src="../../Scripts/jquery-1.4.1.js"></script>
    <script type="text/javascript" language="javascript">

        function callservice() {


这篇关于从MVC调用Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆