今天给大家分享一个小功能,在jQuery环境中,Post data to ashx进行数据交互。

参考下面代码示例:
jQuery post数据至ashx

 

$.ajax({
                     url: '<%= ResolveUrl("~/Handlers/xxx.ashx") %>',
                            dataType: "json",
                            type: "POST",
                            contentType: "application/json; charset=utf-8",
                            data: JSON.stringify({
                                top: 10,
                                term: request.term
                            }),
                            success: function (data) {
                                //...
                            }
                        });
Source Code

相关文章: