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

原文链接: http://www.cnblogs.com/andrewhappy/p/5437280.html
  • 前端页面:

    <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>

转载于:https://www.cnblogs.com/andrewhappy/p/5437280.html

猜你喜欢

转载自blog.csdn.net/weixin_30797027/article/details/94785548