MVC服务器端代码
public ActionResult saleChance(Chances obj)
{
ChancesBLL cb = new ChancesBLL();
List<Chances> list = cb.SelectAll();
list = list.Where(w=>w.ChanName==obj.ChanName&&w.ChanLinkMan==obj.ChanLinkMan&&w.ChanTitle==obj.ChanTitle).ToList();
return Json(list);
}
js客户端代码:
var obj = new Object();
obj.ChanName = $("#ChanName").val();
obj.ChanLinkMan = $("#ChanLinkMan").val();
obj.ChanTitle = $("#ChanTitle").val();
// "ChanName=" + + "&ChanLinkMan=" + $("#ChanLinkMan").val() + "&ChanTitle=" + $("#ChanTitle").val(),
$.post("/Sale/saleManager/saleChance",obj, function (data) {
$(data).each(function () {
alert(this.ChanName);
})