@model YTe.Models.Summernote


@if(Model.LoadLibrary)
{
    <link href="~/summernote/summernote-lite.min.css" rel="stylesheet" />
    <script src="~/admin/assets/libs/jquery/dist/jquery.slim.min.js"></script>
    <script src="~/summernote/summernote-lite.min.js"></script>
}

<script>
    $(document).ready(function () {
        $('@Model.IDEditer').summernote({
            height: @Model.height,
            toolbar: @Html.Raw(Model.toolbar)   
        });
    });


</script>
namespace YTe.Models
{
    public class Summernote
    {
        public Summernote(string iDEditer, bool loadLibrary = true)
        {
            IDEditer = iDEditer;
            LoadLibrary = loadLibrary;
        }

        public string IDEditer { get; set; }

        public bool LoadLibrary { get; set; }

        public int height { get; set; } = 120;

        public string toolbar { get; set; } = @"[
            ['style', ['style']],
            ['font', ['bold', 'underline', 'clear']],
            ['fontname', ['fontname']],
            ['fontsize', ['fontsize']],
            ['color', ['color']],
            ['para', ['ul', 'ol', 'paragraph']],
            ['height', ['height']],
            ['table', ['table']],
            ['insert', ['link', 'picture', 'video']],
            ['view', ['fullscreen', 'codeview', 'help']]
        ]
        ";
    }
}


@model YTe.Models.Post

@{
    ViewData["Title"] = "Edit";
    Layout = "~/Areas/Admin/Views/Shared/_LayoutAdmin.cshtml";
}
<div class="page-breadcrumb">
    <div class="row">
        <div class="col-7 align-self-center">
            <h4 class="page-title text-truncate text-dark font-weight-medium mb-1">Quản lý quyền</h4>
            <div class="d-flex align-items-center">
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb m-0 p-0">
                        <li class="breadcrumb-item"><a href="index.html" class="text-muted">Admin</a></li>
                        <li class="breadcrumb-item text-muted active" aria-current="page">Categories</li>
                    </ol>
                </nav>
            </div>
        </div>
        <div class="col-5 align-self-center">
            <div class="customize-input float-right">
                <select class="custom-select custom-select-set form-control bg-white border-0 custom-shadow custom-radius">
                    <option selected>Aug 19</option>
                    <option value="1">July 19</option>
                    <option value="2">Jun 19</option>
                </select>
            </div>
        </div>
    </div>
</div>
<div class="container-fluid">
    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-body">
                    <form asp-area="Admin" asp-controller="Posts" asp-action="Edit" method="post" enctype="multipart/form-data">
                        <input type="hidden" asp-for="PostId" />
                        <input type="hidden" asp-for="CreateDate" />
                        <input type="hidden" asp-for="Thumb" />
                        <input type="hidden" asp-for="Views" />
                        <input type="hidden" asp-for="Author" />
                        <input type="hidden" asp-for="AccountId" />
                        <div class="form-body">
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label>Tiêu Đề </label>
                                        <input type="text" class="form-control" asp-for="Title">
                                    </div>
                                </div>
                                <div class="form-group col-md-12">
                                    <label class="mr-sm-2" for="inlineFormCustomSelect">Miêu tả ngắn</label>
                                    <input type="text" class="form-control" maxlength="255" asp-for="Scontents">
                                </div>
                                <div class="col-md-4">
                                    <label class="mr-sm-2" for="inlineFormCustomSelect">Danh Mục</label>
                                    <select class="custom-select mr-sm-2" id="inlineFormCustomSelect" asp-items="@ViewBag.DanhMuc" asp-for="CatId">
                                        <option value="0" selected>Danh Mục</option>
                                    </select>
                                </div>
                                <div class=" col-md-8">
                                    <label class="mr-sm-2" for="inlineFormCustomSelect">Ảnh đại diện</label>
                                    <div class="form-group">
                                        <input type="file" name="fThumb" class="form-control-file" id="exampleInputFile" asp-for="Thumb">
                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label>Tags</label>
                                        <input type="text" class="form-control" asp-for="Tags">
                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label>MetaKey</label>
                                        <input type="text" class="form-control" asp-for="MetaKey">
                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label>MetaDesc</label>
                                        <input type="text" class="form-control" asp-for="MetaDesc">
                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <div class="form-group mb-4">
                                        <label class="mr-sm-2" for="inlineFormCustomSelect">Mô tả</label>
                                        <textarea  class="form-control" asp-for="Contents"> </textarea>
                                    </div>
                                </div>
                                <div class="form-check form-check-inline col-md-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" id="customCheck1" asp-for="Published">
                                        <label class="custom-control-label" for="customCheck1">Published</label>
                                    </div>
                                </div>
                                <div class="form-check form-check-inline col-md-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" id="customCheck2" asp-for="IsHot">
                                        <label class="custom-control-label" for="customCheck2">IsHot</label>
                                    </div>
                                </div>
                                <div class="form-check form-check-inline col-md-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" id="customCheck3" asp-for="IsNewfeed">
                                        <label class="custom-control-label" for="customCheck3">IsNewfeed</label>
                                    </div>
                                </div>



                            </div>

                        </div>
                        <br />
                        <div class="form-actions">
                            <div class="text-left">
                              
                                <button type="submit" class="btn btn-rounded btn-outline-info">Edit</button>
                               @*  <button type="reset" id="resetSummernote" class="btn btn-rounded btn-outline-success">Reset</button> *@
                                <button class="btn btn-rounded btn-outline-primary"><a asp-action="Index">Back to List</a></button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

   
    
    @{
        var summernote = new YTe.Models.Summernote("#Contents");
    }

    <partial name="_Summernote" model="summernote" />

    
Vậy thì sao không chạy được