Word Processor in Razor Page

Hi,

I am trying to develop the word processor which is relating the example: https://ej2.syncfusion.com/aspnetcore/DocumentEditor/Default?_gl=1*ephhld*_ga*NjIwNjYwMDIyLjE2NDIxNTUwNjg.*_ga_WC4JKKPHH0*MTY1MDI3MzY4Ni4xNC4xLjE2NTAyNzgzMzUuMA..&_ga=2.5432823.570900326.1650246228-620660022.1642155068#/material in Razor Page.


I copied the exact same code from that example but did some modification since the example is using MVC,

The html code:

<div class="control-section">

            <div id='documenteditor_titlebar' class="e-de-ctn-title"></div>


            <ejs-documenteditorcontainer id="container" enableToolbar=true height="590px">

            </ejs-documenteditorcontainer>

  </div>

=================================================================================

The JavaScript code:

 var documenteditor;


    document.addEventListener('DOMContentLoaded', function () {

        var documenteditorElement = document.getElementById("container");

        var container = documenteditorElement.ej2_instances[0];

        container.showPropertiesPane = true;

        documenteditor = container.documentEditor;

        documenteditorElement.ej2_instances[0].serviceUrl = 'https://localhost:44316/api/documenteditor/';

        documenteditor.serviceUrl = 'https://localhost:44316/api/documenteditor/';

        var ajax = new ej.base.Ajax("@Url.Content("~/scripts/documenteditor/data-default.json")", 'GET', true);

        ajax.send().then();

        ajax.onSuccess = function (data) {

            documenteditor.open(data);

            documenteditor.documentName = 'Getting Started';

            updateDocumentTitle();

        };

        container.documentChange = function (args) {

            updateDocumentTitle();

        };

        titleBarDiv = document.getElementById('documenteditor_titlebar');

        initComponentAndWireEvent();

    });

Also I have added the style street from the example but I guess it doesn't affect the code.

When I try to run it, this is the result


The result only show the  <div id='documenteditor_titlebar' class="e-de-ctn-title"></div> and 

 <ejs-documenteditorcontainer id="container" enableToolbar=true height="590px">

            </ejs-documenteditorcontainer> doesn't show anything even not throwing any exception in console.

How do I check what is the problem? I think the MVC and Razor are not that difference.

Did I miss something important?



3 Replies

AE Ajithamarlin Edward Syncfusion Team April 20, 2022 04:32 AM UTC

Hi Cham,


Can you please confirm whether your requirement is to develop the word processor in ASP.Net Core platform or ASP.Net MVC platform?


Regards,

Ajithamarin E



CC Cham Chang Chuan replied to Ajithamarlin Edward April 20, 2022 06:52 AM UTC

Hi, 


Sorry for confusing, the current platform that I am using is ASP.NET Core platform.


The problem is solved because I found that I missed <ejs-scripts></ejs-scripts>


However, thanks for the replying.





AE Ajithamarlin Edward Syncfusion Team April 20, 2022 06:54 AM UTC

Hi Cham,


Thanks for the update.


Regards,

Ajithamarlin E


Loader.
Up arrow icon