# docx-editor-comments

> Document editor demonstrating threaded comments and at-mention support in the document.

**Framework:** aspnet-core  **Component:** DocxEditor  **Variant:** comments

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/aspnet-core/docx-editor-comments.json
```

**Install Package(s)**

```bash
dotnet add package Syncfusion.AspNetCore.DocumentEditor
```

**Notes**

- Syncfusion release: 2026 Volume 2 (v34.1.29)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/docx-editor-comments/docx-editor.cshtml

```cshtml
<div class="control-section">
    <ejs-documenteditorcontainer id="container" enableToolbar="true" height="590px" userColor="#b70f34"></ejs-documenteditorcontainer>
</div>

<script>
    var documenteditor;
    ej.documenteditor.DocumentEditorContainer.Inject(ej.documenteditor.Toolbar, ej.documenteditor.Ribbon);
    document.addEventListener('DOMContentLoaded', function () {
        var container = document.getElementById('container').ej2_instances[0];
        container.toolbarMode = 'Ribbon';
        container.showPropertiesPane = false;
        container.documentEditorSettings.showRuler = true;
        var mentionData = [
            { "Name": "Selma Rose", "Eimg": "3", "EmailId": "selma@mycompany.com" },
            { "Name": "Russo Kay", "Eimg": "8", "EmailId": "russo@mycompany.com" },
            { "Name": "Camden Kate", "Eimg": "9", "EmailId": "camden@mycompany.com" },
            { "Name": "Mary Kate", "Eimg": "4", "EmailId": "marry@mycompany.com" },
            { "Name": "Ursula Ann", "Eimg": "2", "EmailId": "ursula@mycompany.com" },
        ];
        container.documentEditorSettings.mentionSettings = { dataSource: mentionData, fields: { text: 'Name' }}
        documenteditor = container.documentEditor;
        documenteditor.currentUser = "Nancy Davolio";
        documenteditor.serviceUrl = '@Url.Content("~/api/documenteditor/")';
        var request = new ej.base.Fetch('@Url.Content("~/scripts/documenteditor/data-comments.json")', 'GET');
        request.onSuccess = function (data) {
            documenteditor.open(data);
            documenteditor.documentName = 'Comments';
            documenteditor.showComments = true;
        };
        container.commentDelete = function (args) {
            if (args.author !== documenteditor.currentUser) {
                args.cancel = true;
                ej.popups.DialogUtility.alert({
                    title: 'Information',
                    content: 'Delete restriction enabled. Only the author of the comment can delete it.',
                    showCloseIcon: true,
                    closeOnEscape: true,
                });
            }
        };
        request.send();
    });
</script>
```

### src/components/docx-editor-comments/docx-editor.cshtml.cs

```cs
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Mvc;

namespace EJ2CoreSampleBrowser.Controllers {
    public partial class DocumentEditorController : Controller
    {
        public ActionResult Comments()
        {
            List < object > exportItems = new List<object>();
            exportItems.Add(new { text = "Syncfusion Document Text (*.sfdt)", id = "sfdt" });
            exportItems.Add(new { text = "Word Document (*.docx)", id = "word" });
            exportItems.Add(new { text = "Word Template (*.dotx)", id = "dotx" });
            exportItems.Add(new { text = "Plain Text (*.txt)", id = "txt" });
            ViewData["ExportItems"] = exportItems;
            return View();
        }        
    }
}
```
