Summernote - 图像网址而不是Base64 MVC

时间:2018-01-11 08:15:04

标签: javascript asp.net-mvc summernote

Summernote编辑器将图像文件编码为Base64。我想知道它是否可以选择关闭此编码选项并使用“插入网址”#39;方法而不是。我一直在寻找它,但还没有取得很大的成功。 例如,而不是像......那样存储图像。

<img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMSEhUSERMWFRUVERUVEBUWFRUVFRYVFRUWFxUVFRUYHSggGBolGxUVITEhJSkrLi4uFx8zODMtNygtLisBCgoKDg0OGhAQGi0lHyUtLS0tLS0tLSstLS0tKy0tLS0tLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIAKgBKwMBEQACEQEDEQH/xAAcAAABBQEBAQAAAAAAAAAAAAAEAQIDBQYABwj...........>

应该是

<img src="/Upload/apple.jpg.">

Create.cshtml

        <div class="form-group">
        @Html.LabelFor(model => model.long_Description, htmlAttributes: new { @class = "control-label col-md-4" })
        <div id="summernote"></div>
        <div class="col-md-10">
            @Html.TextAreaFor(model => model.long_Description, new { @id = "long_Description", @style = "display:none;", @class = "form-control" })
            @Html.ValidationMessageFor(model => model.long_Description, "", new { @class = "text-danger" })
        </div>
    </div>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#summernote').summernote(
                {
                    tabsize: 2,
                    height: 150
                });

            var editor = $('#long_Description').html();

            $('#summernote').html(editor);

            $('#editorbtn').hover(function () {

                var editor = $('.note-editable').html();
                $('#long_Description').html(editor);

            });

        });
    </script>

 <input type="submit" value="Add" id="editorbtn" class="btn btn-primary" />

0 个答案:

没有答案