前台代码:
$("#Save").click(function() { // var maindata = {
// ciid: $("#Text1").val(),
// CIInc: $("#company").val(),
// CIIncaddress: $("#address").val()
// }; var id = "aa";
var obj = { ware: [{ wareid: id}] }; //创建数据传一个编号
var oo=JSON.stringify(obj);
//alert(obj);
$.ajax({
type: 'post',
url: '../../WebService.asmx/CallServices',
data: { diclist:oo},
//cache: false,
dataType: 'json',
success: function(result) {
alert("bb");
alert(result); },
error: function(msg) {
var ss = msg.responseXML;
alert(msg.responseText);
} }); });
WebService.asmx中的代码
[WebMethod]
public Dictionary<string, List<Dictionary<string, object>>> CallServices(Dictionary<string, List<Dictionary<string, object>>> diclist)
{
Dictionary<string, List<Dictionary<string, object>>> result = new Dictionary<string, List<Dictionary<string, object>>>();//定义一个数据字典 return result; }
这个是为什么啊?我传单个字符就可以。而且我用最底层的的异步调用是可以的 但是为什么用Jquerey中的ajax就不行呢?
麻烦高手帮忙看看!
$("#Save").click(function() { // var maindata = {
// ciid: $("#Text1").val(),
// CIInc: $("#company").val(),
// CIIncaddress: $("#address").val()
// }; var id = "aa";
var obj = { ware: [{ wareid: id}] }; //创建数据传一个编号
var oo=JSON.stringify(obj);
//alert(obj);
$.ajax({
type: 'post',
url: '../../WebService.asmx/CallServices',
data: { diclist:oo},
//cache: false,
dataType: 'json',
success: function(result) {
alert("bb");
alert(result); },
error: function(msg) {
var ss = msg.responseXML;
alert(msg.responseText);
} }); });
WebService.asmx中的代码
[WebMethod]
public Dictionary<string, List<Dictionary<string, object>>> CallServices(Dictionary<string, List<Dictionary<string, object>>> diclist)
{
Dictionary<string, List<Dictionary<string, object>>> result = new Dictionary<string, List<Dictionary<string, object>>>();//定义一个数据字典 return result; }
这个是为什么啊?我传单个字符就可以。而且我用最底层的的异步调用是可以的 但是为什么用Jquerey中的ajax就不行呢?
麻烦高手帮忙看看!
解决方案 »
- C/S方式,如何从服务器上的Oracle数据库中读取数据?
- 在线等,关于iis部署的问题
- 为什么cs下能通过,换成bs下就会有问题呢
- 瞧瞧
- 如何让两个按钮之间有一定的距离
- 如何将 一个位于iframe的div层悬浮在所有iframe上
- ASP.NET从零开始....
- 怎样将EXCEL嵌入ASP.net网页中,象ASP下的VBA一样的效果,并将数据库的数据读取到EXCEL中?急!!!!!!
- asp可以读取asp.net设cookie值,但asp.net读不到asp设的cookie值,不知是何原因?
- 高手帮忙!如何下载一个文件?
- 如何将datatable转成sqldatasource?
- 关于批量插入数据问题?
{
type: "POST",
url: "",
data:{method:"Test"},//把要调用的函数名作为参数传递到服务器就好了
contentType: "application/json; charset=utf-8",
dataType: "json",
error: function(){alert('出错了');}}
);}); [SoapDocumentMethod("http://tempuri.org/HelloWorld")]
public void HelloWorld()
{ }