MVC系列-13.前台文章显示页

1.在ArticleController里增加action,然后添加对应的视图

首页--Index

前台文章列表--IndexList

后台我的文章列表--MyIndexList

文章管理---ArticleList

wpsE22F.tmp

添加引用:

using PagedList;

using System.Configuration;

using System.Data.Entity

2.编写IndexList方法及view

可查看全部文章,也可根据用户id去查询

wpsE243.tmp

wpsE244.tmp

3.在article控制器下增加Detail方法,并添加视图

(1)加action如下

wpsE255.tmp

(2)添加视图--用选择模板的方法

wpsE265.tmp

(3)改造自动生成的view代码:

wpsE266.tmp

posted @ 2016-06-06 13:13  chenglingr  阅读(156)  评论(0编辑  收藏  举报
生活在继续,我们需要活着