日期:2014-05-17 浏览次数:21004 次
<script src="~/Scripts/ckeditor/ckeditor.js" type="text/javascript"> </script> <script type="text/javascript"> CKEDITOR.replace('@Model'); </script>
/// <summary> /// 新闻 /// </summary> public class News { [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] [Editable(false)] [HiddenInput(DisplayValue = false)] [Display(Name = "标识")] public int Id { get; set; } [Display(Name = "标题")] public string Title { get; set; } [Display(Name = "内容")] [DataType(DataType.MultilineText)] public string Content { get; set; } }
@Scripts.Render("~/bundles/modernizr") @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/jqueryui") @Scripts.Render("~/bundles/jqueryval")
@model Runnersys.Web.Areas.Admin.Models.News @{ ViewBag.Title = "新闻"; Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; } @using (@Html.BeginForm("SaveEdit", "News")) { <fieldset> <legend>@ViewBag.Title</legend> @Html.EditorForModel() <p> <input id="send" type="submit" value="修改" /> @Html.ActionLink("返回", "List") </p> </fieldset> } @Html.Partial("CKEditor", @Html.NameFor(m=>m.Content))
@model Runnersys.Web.Areas.Admin.Models.News @{ ViewBag.Title = Model.Title; Layout = "~/Views/Shared/_Layout.cshtml"; } <h1>@Model.Title</h1> @Html.DisplayTextFor(m=>m.Content)