Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int ID { get; set; }
- [Required]
- [Display(Name = "Titulo del articulo")]
- public string Titulo { get; set; }
- [Required]
- [Display(Name = "Contenido del articulo")]
- [MaxLength(450)]
- [AllowHtml]
- public string Contenido { get; set; }
- [Required]
- [Display(Name = "Descripcion del articulo")]
- [MaxLength(150)]
- public string Descripcion { get; set; }
- [DisplayFormat(DataFormatString = "{0:d}")]
- public DateTime FechaCreacion { get; set; }
- public bool Activo { get; set; }
- public ActionResult Article(int id)
- {
- ArticleService articleService = new ArticleService();
- var model = articleService.GetArticle(id);
- return View(model);
- }
- @model Entidades.Article
- @{
- ViewBag.Title = Model.Titulo;
- }
- <!-- Page Header -->
- <header class="masthead" style="background-image: url('img/post-bg.jpg')">
- <div class="overlay"></div>
- <div class="container">
- <div class="row">
- <div class="col-lg-8 col-md-10 mx-auto">
- <div class="post-heading">
- <h1>@Model.Titulo</h1>
- <h2 class="subheading">@Model.Descripcion</h2>
- <span class="meta">
- Escrito por
- <a href="@Url.Action("Index", "Blog")">Inicio</a>
- @Model.FechaCreacion.ToShortDateString()
- </span>
- </div>
- </div>
- </div>
- </div>
- </header>
- <!-- Post Content -->
- <article>
- <div class="container">
- <div class="row">
- <div class="col-lg-8 col-md-10 mx-auto">
- <p>@Model.Contenido</p>
- </div>
- </div>
- </div>
- </article>
- <hr>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement