后台代码:
ViewBag.smallCategory = categoryService.LoadEntities(m=>m.ParentID==(short)Model.Enum.CategoryEnum.ProductTrade);
ViewData["Total"] = classInfoService.LoadEntities(m => m.Category.ParentID == (short)Model.Enum.CategoryEnum.ProductTrade).ToList().Count;
前台代码:
@{
var data = new ViewDataDictionary();
data.Add("total", ViewData["Total"]);
Html.RenderPartial("../Category/SmallCategory", ViewBag.smallCategory as IEnumerable, data);
}
绑定的页面代码:
@model IEnumerable
@{
Layout = null;
}
共 @Html.ViewData["total"] 条信息
- 所有分类
- 全部
@foreach (var item in Model)
{
@item.CName}
最后
以上就是无心路灯最近收集整理的关于html.renderpartial 命名空间,Html.RenderPartial的三个参数的用法 用法实例的全部内容,更多相关html.renderpartial内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复