# docx-editor-default

> Document editor container with title bar, print, and save-as-docx commands.

**Framework:** aspnet-core  **Component:** DocxEditor  **Variant:** default

## 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-default.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-default/docx-editor.cshtml

```cshtml
@using Syncfusion.EJ2;

<div class="control-section">
    <ejs-documenteditorcontainer id="container" enableToolbar="true" height="590px"></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 = true;
        documenteditor = container.documentEditor;
        documenteditor.serviceUrl = '@Url.Content("~/api/documenteditor/")';

        var request = new ej.base.Fetch('@Url.Content("~/scripts/documenteditor/data-default.json")', 'GET');
        request.onSuccess = function (data) {
            documenteditor.open(data);
            documenteditor.documentName = 'Getting Started';
        };
        request.send();
    });
</script>

```

### src/components/docx-editor-default/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 Default()
        {
            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();
        }        
    }
}
```
