ASP.NET MVC 4实现局部刷新
来源:互联网 发布:excel防止数据粘贴 编辑:程序博客网 时间:2024/06/05 06:13
废话不多说,直接讲我的思路:
利用Ajax+PartialView实现局部刷新。
首先在页面上引用了一个PartialView,当用Ajax更新数据时需要同时更新整个PartialView内容。
Ajax代码:
$.ajax({ url: "url", type: "Post", data: { "sectionid": sectionId, "questions": ids.join(",") }, success: function (data) { //TODO:更新后的处理代码 $("Selector").html(data); }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("保存失败:" + errorThrown); } });
后台C#代码:
[HttpPost] public ActionResult UpdateSection(int sectionid, string questions) { try { //更新PartialView return PartialView("ViewSection", newSection); } catch (Exception exp) { throw exp; } }就这么简单,根本不需要拼接字符串什么的。
0 1
- ASP.NET MVC 4实现局部刷新
- asp.net 使用UpdatePanel实现局部刷新
- ASP.NET中局部刷新的实现
- asp.NET UpdatePanel实现异步局部刷新
- asp.net实现页面局部自动刷新
- 在ASP.NET MVC中使用Juqery实现页面局部刷新
- 在ASP.NET MVC中使用Jquery实现页面局部刷新
- 在ASP.NET MVC中使用Juqery实现页面局部刷新
- ASP.NET 局部刷新
- 解决asp.net MVC 中局部刷新的问题
- .net MVC中如何使用iframe实现局部刷新
- JQuery Ajax 结合.net MVC框架实现页面局部刷新
- MVC实现局部视图刷新
- ASP.NET页面局部刷新
- asp.net局部刷新数据库
- ASP.Net页面局部刷新
- asp.net mvc3 利用Ajax实现局部刷新
- ASP.NET AJAX UpdatePanel 不能实现局部刷新原因
- centos rpm安装jdk
- Kafka设计解析(二):Kafka High Availability (上)
- 第8周项目1-实现复数类中的运算符重载(2)
- 文件误删后,ubuntu系统重新安装pycharm.
- 【学习ARToolkit小记之三】 摄像头标定(Camera Calibration)
- ASP.NET MVC 4实现局部刷新
- loaded the "BlueView" nib but the view outlet was not set 错误的解决办法
- 【Unity】GPU优化
- Storing Magento sessions in memcached via socket
- asp.net系统中根据经纬度坐标,直接调用google地图,显示位置
- vs2010 注释与取消注释
- 黑马程序员——Java基础视频笔记(一)
- MFC控件添加变量时,control和value的区别
- Xilinx ISE Design Suite 14.7 ISim 简单仿真