1

我是 ajax 新手,我发现将数据从客户端发送到服务器非常容易,反之则很难实现。

我想要的只是将一些参数发送到我的asp服务器并在回调完成时接收一个字符串作为回报。
这是我对 ajax 的呼吁:

$.ajax(
         { url: "Default.aspx"}, 
         { ajaxPost:"post", 
           ajaxPostValName: name, 
           ajaxPostValDate: currdate, 
           ajaxPostValFile: file, 
           ajaxPostValCell: cell, 
           ajaxPostValChannel: channel}).done(
               function ( "need string result from here") { "do my string parsing here" });

我尝试在 done func 中使用“data”var 获取数据,但我得到了整个页面。

建议?

谢谢

4

1 回答 1

0

您只需要在您的内容中回显某些Default.aspx内容并以这种方式调用您的 ajax

$.ajax({ url: "Default.aspx"}, { ajaxPost:"post", ajaxPostValName: name, ajaxPostValDate: currdate, ajaxPostValFile: file, ajaxPostValCell: cell, ajaxPostValChannel: channel}).done(
function ( data ) { 
    //do what you want with the data variable
});
于 2013-02-14T14:34:29.767 回答