Skip to content

Instantly share code, notes, and snippets.

@Maarten88
Last active December 17, 2015 07:48
Show Gist options
  • Save Maarten88/5575007 to your computer and use it in GitHub Desktop.
Save Maarten88/5575007 to your computer and use it in GitHub Desktop.
@model Auction.Web.Domain.Models.ContentPage
@{
ViewBag.Title = Model.Title;
ViewBag.Description = Model.Markdown.Substring(0, Math.Min(Model.Markdown.Length - 1, 50));
}
<article class="content-item">
<header>
<h1>@Model.Title</h1>
</header>
@Html.Markdown(Model.Markdown)
</article>
@model Auction.Web.Domain.Models.ContentPage
@{
ViewBag.Title = "Edit Content Page";
}
<h2>@ViewBag.Title</h2>
@using (Html.BeginForm(null, null, FormMethod.Post, new { @class = "form-inline" }))
{
<div class="well">
@Html.ValidationSummary(true)
@Html.HiddenFor(model => model.Id)
@Html.EditorFor(model => model.Slug)
@Html.EditorFor(model => model.Title)
@Html.EditorFor(model => model.Markdown, "Markdown")
</div>
<div class="form-actions">
<button class="btn btn-primary" type="submit">Save</button>
@Html.ActionLink("Cancel", "Index", null, new { @class = "btn" })
</div>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment