Source

Presentations / ASP.NET MVC / Samples / Action Results / Views / Home / Index.aspx

Full commit
paulstovell 32af711 








































<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Sample.Controllers.HomeController.IndexModel>" %>

<asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server">
    WhatTimeIsIt.com
</asp:Content>

<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2><%= Model.CurrentZone.DisplayName %> Time</h2>
    
    <div class="timearea">
        <div class="time">
            <%= Model.CurrentTime.ToShortTimeString() %>
        </div>
        <div class="date">
            <%= Model.CurrentTime.ToLongDateString() %>
        </div>
    </div>
    
    <div class="refresharea">
        <%= Html.ActionLink("Refresh", "Index", new { timeZone =  Model.CurrentZone.Id }) %>
    </div>
    
    <h3>Add to Calendar</h3>
    <div class="calendar">
        <% using (Html.BeginForm("AddToCalendar", "Home", FormMethod.Post)) { %>
        
            Subject: <%= Html.TextBox("summary") %>
        
            <input type="submit" />
        <% } %>
    </div>
    
    <h3>Select another zone</h3>
    <div class="otherzones">
        <% foreach (var timeZone in Model.TimeZones) { %>
        <span class="zonelink">
            <%= Html.ActionLink(timeZone.DisplayName, "Index", new { timeZone = timeZone.Id } ) %>
        </span>
        <% } %>
    </div>
    
</asp:Content>