|
<%@ Page Title="Archived Posts" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" CodeBehind="Archive.aspx.cs" Inherits="MvcCalendarSample.Views.Home.Archive" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<h2>Mvc Calendar 4: with data and links and selected date</h2>
<%
var selectedDate = DateTime.Parse(ViewData["date"].ToString());
var allPosts = MvcCalendarSample.Models.Post.GetAllPosts();
var datesArray = from d in allPosts
select new DateTime(d.CreatedAt.Ticks);
%>
<%= Html.Calendar("archiveCalendar", selectedDate, datesArray, "home", "archive") %>
<hr />
<h2>Archived posts in <%= ViewData["date"] %></h2>
<%
var selectedPosts = ViewData["posts"] as List<MvcCalendarSample.Models.Post>;
%>
<p>Total <%= selectedPosts.Count%> posts in <%= ViewData["date"] %></p>
<% foreach (var post in selectedPosts)
{ %>
<p>[<%= post.CreatedAt %>] <a href="#"><%= post.Title %></a></p>
<%} %>
</asp:Content>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.