Search code examples
javascriptasp.net-mvcasp.net-coretinymcetinymce-plugins

TinyMCE: Referer header is missing error in asp.net mvc


I created an account in TinyMCE and got the API key.

after that, I added Localhost in my approved Domain and my script looks like below

<script src="https://cdn.tiny.cloud/1/APIKey/tinymce/7/tinymce.min.js" referrerpolicy="origin"></script>

I went to this URL and downloaded the script to use it locally in my asp.net MVC application after that, it looks like below

but I am getting the below error ->

We’re unable to check your domain because the referer header is missing.

Ensure your referer header is present, so we can then customize your editor experience.

Read to learn more: https://www.tiny.cloud/docs/tinymce/6/cloud-troubleshooting/

↓↓↓↓↓ ATTENTION ADMINS ↓↓↓↓↓ Please include these details in Tiny Cloud support requests. Resolved API key: no-origin Editor read-only?: no Origin: http://localhost:32695 Tiny Cloud entry URL: http://localhost:32695/Content/plugins/TinyMCE/tinymce.min.js ↑↑↑↑↑ ---------------- ↑↑↑↑↑ I @ tinymce.min.js:18 value @ tinymce.min.js:18 tcsl @ tinymce.min.js:32 (anonymous) @ tinymce.min.js:33Understand this warning

Even after providing the API key and approving the domain why I am getting the above error?


Solution

  • Your import method has some problem,you can try to install TinyMCE package Following the official tutorial : https://www.tiny.cloud/docs/tinymce/6/dotnet-projects/

    1.install the Ti nyMCE package to the project

    enter image description here

    2. Import tinymce.js in _layout.cshtml:

     <script src="~/lib/tinymce/tinymce.js" referrerpolicy="origin"></script>
    

    3.It works like this:

    enter image description here