Я пробовал реализовать редактор summernote wysiwyg в моем проекте MVP Asp.Net согласно учебнику here.Summernote в Asp.Net MVC
Я думал, что получаю ту же проблему, что и this guy, и внедрил предложения, но все еще не помогло.
Я также внес изменения в файл web.config в соответствии с here, чтобы попытаться исправить проблему с глификонами, но также безрезультатно.
Если кто-нибудь может сказать мне, что я делаю неправильно, будем очень благодарны.
См текстовую область в текстовой области и значки кнопок не оказывающего
Rendered HTML в соответствии с Chrome Debugger
.cshtml
<div class="form-group">
@Html.LabelFor(model => model.Recipe.Instructions, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.TextAreaFor(model => model.Recipe.Instructions, htmlAttributes: new { @class = "form-control" })
@Html.ValidationMessageFor(model => model.Recipe.Instructions, "", new { @class = "text-danger" })
</div>
</div>
Bundle
public class BundleConfig
{
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles) {
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.validate*"));
// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js",
"~/Scripts/respond.js"));
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/font-awesome.css",
"~/Content/site.css",
"~/Content/globalStyles.css"));
bundles.Add(new StyleBundle("~/Content/summernote").Include(
"~/Content/summernote/summernote.css"
));
bundles.Add(new ScriptBundle("~/bundles/summernote").Include(
"~/Content/summernote/summernote.js"
));
}
}
структура файла
ошибки хром
Я ничего summernote не знаю, но '@ Html.TextAreaFor (модель = > model.Recipe.Instructions, new {htmlAttributes = new {@class = "form-control"}}) 'выглядит очень неправильно. Возможно, вы имели в виду '@ Html.TextAreaFor (model => model.Recipe.Instructions, htmlAttributes: new {@class =" form-control "})'? –
И не отправляйте код в виде изображений, он абсолютно ничего не делает, делая поиск (и заставил меня набирать все это вручную) –
@PaulAbbot 'new {htmlAttributes = new {@class =" form-control "}}) 'был создан vs2015. Я попробовал более старый способ, и это не имело никакого значения. Меняя мой вопрос сейчас, чтобы заменить скриншоты кодом – rory