码迷,mamicode.com
首页 > Web开发 > 详细

MVC-AJAX-JSON

时间:2017-05-18 15:47:07      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:str   return   htable   res   osi   har   func   success   ash   

前台:

 function get_page_count() {
        $.ajax({
            type: "GET",
            data: { typeId: $("#select").val(), keyWord: $("#key_word").val() }, 
            cache: false,
            url: ‘/ResourceProvie/get_pageCount‘,
            dataType: "json",
            success: function (result) {

                alert("a" + result);
            },
            error: function (result) {
                alert(result);
                alert("b");
            }
        }

        );
后台:
 public ActionResult get_pageCount(int? typeId, string keyWord)
        {
            int pageCount = 0;
           
             _resourceRepository.get_pageCount(typeId, keyWord, ref pageCount);
             Hashtable hash = new Hashtable();
             hash["pageCount"] = pageCount;
             return Json(hash,"text/html;charset=UTF-8");
        }

MVC-AJAX-JSON

标签:str   return   htable   res   osi   har   func   success   ash   

原文地址:http://www.cnblogs.com/914556495wxkj/p/6873522.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!