asp.net mvc 动态显示不同的部分视图
2015-09-13 18:26
603 查看
首先是AJAX请求
先时代位置 就是在
在控制器里面
好咯 大功告成
//第一次打开 默认s单行文本 $.ajax({ type: "GET", url: "/Admin/Field/ChoiceType4Edit", data: { fieldtype: "@Html.ValueFor(m => m.Type)", fieldid: "@Html.ValueFor(m => m.ID)" }, dataType: "html",//格式是html success: function (evt) { $('#rescontent').html(evt);//替换成新的数据 } });
先时代位置 就是在
<tbody id="rescontent"></tbody>
在控制器里面
public PartialViewResult ChoiceType(string fieldtype) { FieldInfo info = new FieldInfo(); return PartialView(string.Format(@"~/Skin/Sky/Admin/Field/_{0}.cshtml", fieldtype), info); }
好咯 大功告成
相关文章推荐
- ASP.NET MVC 路由机制
- Asp.Net MVC 合并js或css请求
- 三张图片解析ASP.net的整个生命周期
- asp.net-mvc的传值方式
- asp.net学习手记(一)
- asp.net2.0安全性(4)--Login系列控件--转载来自车老师
- asp.net2.0安全性(3)--验证与授权--转载来自车老师
- asp.net2.0安全性(2)--用户个性化设置(2)--转载来自车老师
- asp.net2.0安全性(2)--用户个性化设置(1)--转载来自车老师
- asp.net2.0安全性(1)--用户角色篇(代码实现2)--转载来自车老师
- asp.net2.0安全性(1)--用户角色篇(代码实现1)--转载来自车老师
- asp.net2.0安全性(1)--用户角色篇(类)--转载来自车老师
- asp.net2.0安全性(1)--用户角色篇(起篇)--转载来自车老师
- [Raspbian]SSH连接到RaspberryPi进行操控
- Raspberry pi wifi热点续
- ASP.NET State Server 服务 sessionState
- 关于Metasploit-学习笔记-基础命令以及参数
- Metasploit CVE-2015-5122 Flash漏洞利用检测试验
- ASP.NET MVC 快速开发框架之 SqlSugar+SyntacticSugar+JQWidgetsSugar+jqwidgets(转)
- asp.net页面之间的传值