<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Page.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<%@ Import Namespace="MVCBlogo.NET.BO" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderPage" runat="server">

   <div class="post">
     <h3>包括分类：<%=ViewData["TagName"]%>的文章如下：</h3>
   </div>
     <%
    List<BlogEntry> list = ViewData.Model as List<BlogEntry>;
    foreach (var post in list)
    {
 %>
 <div class="post">
    <div class="header">
        <%=Html.ActionLink(post.title,"BlogEntry",new{page=post.id}) %><!--链接文章的名称-->
        <div class="date"><%=post.datecreated %></div> <!--文章发表日期-->
    </div>
    <div class="content">
        <%=post.body %> <!--文章的内容-->
       <p><strong><%=post.author.username %></strong></p><!--文章的作者--> 
    </div>
    <div class="footer">
       <ul>
         <li class="tags">分类：
                 <%foreach (var tag in post.tags)
                   {
                  %>
                     <%=Html.ActionLink(tag.tagname,"BlogEntry",new{id=post.id}) %>  <!--链接文章的分类-->
                  <%
                   } %>
             </li>
             <li class="comments">   <!--观看文章的评论 -->
                  <%=(bool)post.allowcomments ?"<a href=\"BlogEntry.aspx?page="+post.id+"#comments\">评论("+post.comments.Count+")</a>":"-disabled-"%>
             </li>
       </ul>
    </div>
 </div>
 <%} %>
 <%=Html.ActionLink("《前一页","BlogByTag",new{id=(int)ViewData["TagId"],page=(int)ViewData["Page"]-1}) %> | <!--传递的参数为分类的ID号，分页的索引-->
  <%=Html.ActionLink("后一页》","BlogByTag",new{id=(int)ViewData["TagId"],page=(int)ViewData["Page"]+1}) %> |
</asp:Content>
