首页
视频
资源
登录
原
ASP.NET MVC 分部页
4244
人阅读
2022/3/21 13:11
总访问:
587042
评论:
0
收藏:
0
手机
分类:
.net
PartialViewResult返回的也是一个页面,可以使用@Html.Partial加载这个部分页面,需要多次使用的时候可以用到他 ``` public PartialViewResult _pxcx(string polName, string podName, string carrCode, string lineName, int page = 1) { int total = 0; var list = _Price_InfoManagement.GetDTO_PRICELCL_List(polName, podName, carrCode, "", "", lineName, "", page, pageSize, out total); ViewBag.Pager = PagerHelper.CreatePagerByAjax(page, pageSize, total, "lcl.priceQuery", false, lang == "CN"); return PartialView(list);//传入集合aps.net会解析好,然后返回一个页面html } ``` ``` @model List<GTDesk.Domain.MainModule.Entities.DTO.DTO_C_PRICE> <table width="100%" border="0" class="lcl-table tac"> <tr id="thead"> <th scope="col">@ViewData["起始港"]</th> <th scope="col">@ViewData["目的港"]</th> <th scope="col">@ViewData["船公司"]</th> <th scope="col">@ViewData["船期"]</th> <th scope="col">@ViewData["航程"]</th> <th scope="col">@ViewData["中转港"]</th> <th scope="col">20GP</th> <th scope="col">40GP</th> <th scope="col">40HQ</th> <th scope="col">@ViewData["附加费"]</th> <th scope="col">@ViewData["有效日期"]</th> <th scope="col">@ViewData["Key_BookOnline"]</th> </tr> @if (Model != null && Model.Any()) { foreach (var item in Model) { <tr> <td>@item.POL_NAME_EN</td> <td>@item.POD_NAME_EN</td> <td>@item.CARR_CODE</td> <td>@item.ETD </td> <td>@item.TRANSIT_TIME</td> <td>@(string.IsNullOrEmpty(item.POT_NAME_EN) ? "直达" : item.POT_NAME_EN)</td> <td> <p class="wz2">@(item.PR_PRICE_20.HasValue?item.PR_PRICE_20.Value.ToString("00"):"")</p></td> <td><p class="wz2">@(item.PR_PRICE_40.HasValue?item.PR_PRICE_40.Value.ToString("00"):"")</p></td> <td><p class="wz2">@(item.PR_PRICE_40HQ.HasValue?item.PR_PRICE_40HQ.Value.ToString("00"):"")</p></td> ``` 加载部分页面 @Html.Partial("_pxcx", Model) 分页的时候其实就是改变的中间这一块,可以用ajax请求_pxcx,返回的是html在用js这返回的html加载到需要的地方就可以了 ``` //拼箱 var lcl = { //运价查询 priceQuery: function (index) { var polName = $("#POL_NAME_EN").combogrid('getValue'); var lineName = $("#LineId").combobox('getValue'); var podName = $('#POD_NAME_EN').combogrid('getValue'); var carrCode = $('#CARR_CODE').combogrid('getValue'); $.post('/home/_pxcx', { polName: polName, podName: podName, carrCode: carrCode, lineName: lineName, week: '', boxType: '', page: index }, function (data) { $('#price_box').html(data); }); } }; ``` 所以用zazor在后台组织数据返回的页面,也是可以实现ajax分页的
欢迎加群讨论技术,1群:677373950(满了,可以加,但通过不了),2群:656732739
👈{{preArticle.title}}
👉{{nextArticle.title}}
评价
{{titleitem}}
{{titleitem}}
{{item.content}}
{{titleitem}}
{{titleitem}}
{{item.content}}
TeachingNote
这一生多幸运赶上过你.
博主信息
排名
6
文章
6
粉丝
16
评论
8
文章类别
.net
37篇
后端
5篇
ORM
16篇
前端
48篇
随笔
13篇
移动开发
6篇
数据库
6篇
英语
3篇
rabbitmq
1篇
.net core
5篇
unity
1篇
k8s
1篇
云服务
1篇
DDD
1篇
网络
1篇
更多
mysql
1篇
python
2篇
docker
1篇
最新文章
最新评价
{{item.articleTitle}}
{{item.blogName}}
:
{{item.content}}
关于我们
ICP备案 :
渝ICP备18016597号-1
网站信息:
2018-2024
TNBLOG.NET
技术交流:
群号656732739
联系我们:
contact@tnblog.net
欢迎加群
欢迎加群交流技术