Develop your own blog (ASP. Mvc+ef codefrist)-Timeline small function
Want to write a similar effect on the timeline to find a plug-in
The front end has found a simple plug-in address http://sc.chinaz.com/jiaoben/130509308250.htm
This is the entity class
public class timnaxis:baseentity<int> { [Required (errormessage = "{0} is required")] [Display ( Name = "Time")] "public DateTime" {get; set;} [Required (errormessage = "{0} is required")] [Display (Name = "title")] [Stringlength (errormessage = "Length must be less than {1} words")] public string Title {get; set;} [ Required (errormessage = "{0} is required")] [Display (Name = "Content")] [Stringlength (errormessage = "Length must be less than {1} words" c17>)] public string Content {get; set;}}
This is the controller.
[HttpGet] Public ActionResult Timnaxis (bool isall=false) { viewbag.webinfo = WebInfo; List<timnaxis> timnaxises=new list<timnaxis> (); if (Isall) { timnaxises = Itimnaxismanager.findlist (). (t = t.time). ToList (); } else { timnaxises = Itimnaxismanager.findlist (). (t = t.time). Take (30). ToList (); } Return View (timnaxises); }
Dependent scripts and looping out content
@section style{<link rel="stylesheet"Type="Text/css"href="/content/timeaxis/css/default.css"/> <link rel="stylesheet"Type="Text/css"href="/content/timeaxis/css/component.css"/>} @section scripts{<script src="/content/timeaxis/js/modernizr.custom.js"></script>}
<div class= "main" > <ul class= "Cbp_tmtimeline" > @{ foreach (var item in Model) { < li> <time class= "Cbp_tmtime" datetime= "2013-04-18 09:56" > <span style= "font-size:20px" > @item. Time.tostring ("Yyyy/mm/dd") </span> <span style= "font-size:25px" > @item. Time.hour: @item. time.minute</span> </time> <div class= "Cbp_tmicon cbp_tmicon-phone" ></div> <div class= "Cbp_tmlabel" >
Front desk
Background
Bootstrap table for simple management
Personal blog Address http://www.yhyboy.top/
Develop your own blog (ASP. Mvc+ef codefrist)-Small-course features