/// <summary>
/// 根栏目
/// </summary>
/// <returns></returns>
public ActionResult PartialRoot()
{
return View(categoryRsy.Root());
}
@model IEnumerable<Ninesky.Models.Category>
@Html.ActionLink("网站首页", "Index", "Home")@foreach (var item in Model)
{
@Html.ActionLink(item.Name, "Index", "Category", new { id = item.CategoryId }, null)
}
/// <summary>
/// 子栏目
/// </summary>
/// <param name="id">栏目id</param>
/// <returns></returns>
public ActionResult PartialChildren(int id)
{
return View(categoryRsy.Children(id));
}
@model IEnumerable<Ninesky.Models.Category>
<ul>
@foreach (var item in Model)
{
<li>@Html.ActionLink(item.Name, "Index", "Category", new { id = item.CategoryId }, null)</li>
}
</ul>
/// <summary>
/// 栏目路径
/// </summary>
/// <param name="id">当前栏目Id</param>
/// <returns></returns>
public ActionResult PartialPath(int id)
{
List<Category> _path = new List<Category>();
var _category = categoryRsy.Find(id);
while (_category != null)
{
_path.Insert(0, _category);
_category = categoryRsy.Find(_category.ParentId);
}
return View(_path);
}
@model IEnumerable<Ninesky.Models.Category>
您现在的位置:@Html.ActionLink("网站首页", "Index", "Home")@foreach (var item in Model)
{
@Html.Raw(">>") @Html.ActionLink(item.Name, "Index", "Category", new { id = item.CategoryId }, null)
}
/// <summary>
/// 索引
/// </summary>
/// <param name="id">栏目id</param>
/// <returns></returns>
public ActionResult Index(int id)
{
var _category = categoryRsy.Find(id);
if (_category == null)
{
Error _e = new Error { Title = "错误", Details = "指定的栏目不存在", Cause = "你访问的栏目已经删除", Solution = Server.UrlEncode("<li>返回<a href='" + Url.Action("Index", "Home") + "'>网站首页</a></li>") };
return RedirectToAction("Error", "Prompt", _e);
}
if (_category.Type == 2) return Redirect(_category.Navigation);
return View(_category.CategoryView,_category);
}
@model Ninesky.Models.Category
@{
ViewBag.Title = "栏目默认页";
Layout = "~/Views/Layout/_Layout.cshtml";
}
<div class="banner">
<img src="~/Skins/Default/Images/banner.jpg" />
</div>
<div class="left">
<div class="children">
<dl>
<dt>@Model.Name</dt>
<dd>@Html.Action("PartialChildren", "Category", new { id = Model.CategoryId })</dd>
</dl>
</div>
</div>
<div class="content_cnt">
<div class="path">@Html.Action("PartialPath", "Category", new { id = Model.CategoryId })</div>
</div>
@model Ninesky.Models.Category
@{
ViewBag.Title = "关于我们";
Layout = "~/Views/Layout/_Layout.cshtml";
}
<div class="banner">
<img src="~/Skins/Default/Images/banner.jpg" />
</div>
<div class="left">
<div class="children">
<dl>
<dt>@Model.Name</dt>
<dd>@Html.Action("PartialChildren", "Category", new { id = Model.CategoryId })</dd>
</dl>
</div>
</div>
<div class="content_cnt">
<div class="path">@Html.Action("PartialPath", "Category", new { id = Model.CategoryId })</div>
<div class="singlepage">
<div class="title">@Model.Name About </div>
<p>
<b>NineSky</b>® 是洞庭夕照学习Mvc的一个项目。是想通过完成一个网站来不断的督促自己、不断的学习和实践。最终希望可以写出一个可简洁、易用的网站。
</p>
<p>目的:学习mvc4</p>
<p>目标:简单、易用、实用</p>
</div>
</div>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有