Search results

Footnotes and Endnotes in ASP.NET MVC DocumentEditor control

22 Jul 2021 / 1 minute to read

DocumentEditorContainer component provides support for inserting footnotes and endnotes through the in-built toolbar. Refer to the following screenshot.

Insert footnote endnote

The Footnotes and endnotes are both ways of adding extra bits of information to your writing outside of the main text. You can use footnotes and endnotes to add side comments to your work or to place other publications like books, articles, or websites.

Insert footnotes

Document editor exposes an API to insert footnotes at cursor position programmatically or can be inserted to the end of selected text.

razor
document-editor.cs
Copied to clipboard
@Html.EJS().Button("insertFootnote").Content("insert Footnote").Render()
<div id="documenteditor" style="width:100%;height:100%">
    @Html.EJS().DocumentEditor("DocumentEditor").IsReadOnly(false).EnableEditor(true).EnableSelection(true).EnableSfdtExport(true).Render()
</div>
<script>
    var documenteditor;
    document.addEventListener('DOMContentLoaded', function () {
        documenteditor = document.getElementById('DocumentEditor').ej2_instances[0];
        documenteditor.resize();
    });    
    document.getElementById('insertFootnote').addEventListener('click', function () {
        documenteditor.editor.insertFootnote();
    });

</script>
Copied to clipboard
public ActionResult Default()
    {
        return View();
    }

Insert endnotes

Document editor exposes an API to insert endnotes at cursor position programmatically or can be inserted to the end of selected text.

razor
document-editor.cs
Copied to clipboard
@Html.EJS().Button("InsertEndnote").Content("Insert Endnote").Render()
<div id="documenteditor" style="width:100%;height:100%">
    @Html.EJS().DocumentEditor("DocumentEditor").IsReadOnly(false).EnableEditor(true).EnableSelection(true).EnableSfdtExport(true).Render()
</div>
<script>
    var documenteditor;
    document.addEventListener('DOMContentLoaded', function () {
        documenteditor = document.getElementById('DocumentEditor').ej2_instances[0];
        documenteditor.resize();
    });    
    document.getElementById('InsertEndnote').addEventListener('click', function () {
        documenteditor.editor.insertEndnote();
    });

</script>
Copied to clipboard
public ActionResult Default()
    {
        return View();
    }

Update or edit footnotes and endnotes

You can update or edit the footnotes and endnotes using the built-in context menu shown up by right-clicking it. the footnote endnote dialog box popup and you can customize the number format and start at. Refer to the following screenshot.

Update or edit footnotes and endnotes