Jquery.ajax发送参数调用.Net Mvc子方法返回一个子页面嵌入当前页

  • 前端页面:

    <div id='预留位置'>

    </div>

$.ajax({
            url: '@Url.Action("子方法")',     //调用子方法(child action)
            type: 'POST',
            data: ({ 参数名称: 值 }),      //注意括号         
            dataType: 'html',        //返回html格式
            success: function (result) {  $('#预留位置').html(result); }

  •  后端Control:

    [HttpPost]
        public ActionResult 子方法(string 参数名称)
        {...}

  • 后端 Child View:

     <p>该干嘛干嘛</p>

posted @ 2016-04-27 00:13  Andrew Happy  阅读(306)  评论(0编辑  收藏  举报