In this article I will explain with an example, how to implement TinyMCE RichTextBox (RichTextEditor) in ASP.Net Core Razor Pages.
TinyMCE RichTextBox (RichTextEditor) is a JavaScript plugin and is applied to the HTML TextArea element.
Note: For beginners in ASP.Net MVC Core Razor Pages, please refer my article ASP.Net Core Razor Pages: Hello World Tutorial with Sample Program example.
Razor PageModel (Code-Behind)
The PageModel consists of the following two Handler methods.
Handler method for handling GET operation
This Handler method is left empty as it is not required.
Handler method for handling POST operation
This Handler method handles the call made from the POST function from the Page.
When the Form is submitted, the posted value is captured through the personalDetails parameter and it is assigned to the PersonalDetails property which is later used to display the value on the Page.
public class IndexModel : PageModel
    public string PersonalDetails { get; set; }
    public void OnGet()
    public void OnPostSubmit(string personalDetails)
        this.PersonalDetails = personalDetails;
Razor Page (HTML)
The HTML of Razor Page consists of an HTML TextArea and a Submit Button.
The Submit Button has been set with the POST Handler method using the asp-page-handler attribute.
Note: In the Razor PageModel, the Handler method name is OnPostSubmit but here it will be specified as Submit when calling from the Razor HTML Page.
When the Submit button is clicked, the Form gets submitted and the value of the PersonalDetails property is displayed using HTML SPAN.
@addTagHelper*, Microsoft.AspNetCore.Mvc.TagHelpers
@model TinyMCE_Razor_Core.Pages.IndexModel
    Layout = null;
<!DOCTYPE html>
    <meta name="viewport" content="width=device-width"/>
    <form method="post">
        Personal Details:
        <textarea cols="20" rows="3" name="PersonalDetails"></textarea>
        <input type="submit" value="Submit" asp-page-handler="Submit"/>
    <script type="text/javascript" src=""></script>
    <script type="text/javascript">
        tinymce.init({ selector: 'textarea', width: 300 });
ASP.Net Core Razor Pages: TinyMCE RichTextBox (RichTextEditor)