在asp.net Web服务中获取或发布数据 [英] Get Or Post Data in asp.net web service

查看:48
本文介绍了在asp.net Web服务中获取或发布数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在asp.net中,我有一个Web服务(.asmx),并通过ajax post方法调用它.

In asp.net I have a webservice (.asmx) and I call it by ajax post method

$.ajax({
       type: "POST",
       url: "/MyReportService.asmx/ReportData",
       data: "{'objPrintData':'" + jsonDataSet + "'}",
       contentType: "application/json; charset=utf-8",
       dataType: "json",
       success: function (response) {
       },
       failure: function (msg) {
           $('#output').text(msg);
       }
       });


当我托管此应用程序时,它是如何工作的.即,我无法访问此Web服务.
谢谢


When I host this application how does it work.i.e I can''t access this web service.
Thanks

推荐答案

.ajax({ 类型:" , 网址:" , 数据:" + jsonDataSet + " , contentType:" , dataType:" , 成功:功能(响应){ }, 失败:功能(msg){
.ajax({ type: "POST", url: "/MyReportService.asmx/ReportData", data: "{'objPrintData':'" + jsonDataSet + "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (response) { }, failure: function (msg) {


(' #output').text(msg); } });
('#output').text(msg); } });


当我托管此应用程序时,它是如何工作的.即,我无法访问此Web服务.
谢谢


When I host this application how does it work.i.e I can''t access this web service.
Thanks


尝试:

try:

<script src="Scripts/jquery-1.4.3.min.js" type="text/javascript"></script>
<script type="text/javascript">


这篇关于在asp.net Web服务中获取或发布数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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