@using TightWiki.Models @model TightWiki.Models.ViewModels.Page.PageEditViewModel @{ Layout = "/Views/Shared/_Layout.cshtml"; var sessionState = ViewData["SessionState"] as TightWiki.SessionState ?? throw new Exception("Wiki State Context cannot be null."); }

Content

@if (!string.IsNullOrEmpty(Model.ErrorMessage)) {
@Html.Raw(Model.ErrorMessage)
} @if (!string.IsNullOrEmpty(Model.SuccessMessage)) {
@Html.Raw(Model.SuccessMessage)
} @using (Html.BeginForm(null, null, FormMethod.Post, new { action = $"{GlobalConfiguration.BasePath}{Context.Request.Path}" })) { @Html.HiddenFor(x => x.Id)
View

@Html.LabelFor(x => x.Name)
@Html.TextBoxFor(x => x.Name, new { style = "width:50%" })
@Html.ValidationMessageFor(m => m.Name)

@Html.LabelFor(x => x.Description)
@Html.TextBoxFor(x => x.Description, new { style = "width:90%" })
@Html.ValidationMessageFor(m => m.Description)

@Html.LabelFor(x => x.Body)
@Html.ValidationMessageFor(m => m.Body)

View
}

Attachments

@if (Model?.Id > 0 && @sessionState.CanCreate == true) {
Drop file attachments here or click to upload manually.
} else {
Save the page before uploading files.
}