我可以從ASP.Net MVC中的Controller Action調用webservice嗎?我可以從ASP.Net MVC中的Controller Action調用webservice嗎?
public ActionResult Index()
{
PersonObject person = new Person("Sam");
//Call a webservice which is located in the same app under /Services/General.asmx/WebMethod and pass it person
}
基本上我想從我的行動做到這一點...
$.ajax({
type: "POST",
url: "/Services/General.asmx/WebMethod",
data: JSON.stringify(DTOInternetPricing),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(res) {
},
error: function(res) {
}
});
什麼樣的網絡服務?你的意思是你的控制器操作是你的網絡服務?你是從哪裏來的? – 2010-10-27 04:06:02
更新我的問題.. – Jason 2010-10-27 04:20:31