In this article I will explain with an example, how to create Modal Popup windows using jQuery UI Dialog in ASP.Net Core Razor Pages.
Note: For beginners in ASP.Net 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 following Handler method.
Handler method for handling GET operation
This Handler method left empty as it is not required.
public class IndexModel : PageModel
    public void OnGet()
Razor Page (HTML)
The HTML of Razor Page consists of an INPUT Button and an HTML DIV for displaying Modal Popup.
jQuery Modal Popup plugin implementation
Inside the HTML Markup, the following jQuery UI CSS file is inherited.
1. jquery-ui.css
And then, the following jQuery and jQuery UI JS scripts are inherited.
1. jquery.min.js
2. jquery-ui.js
Opening the jQuery Modal Popup
The INPUT Button has been assigned with jQuery click event handler.
Inside this event handler, the jQuery UI Dialog plugin has been applied to the HTML DIV and its title property is set.
Closing the jQuery Modal Popup
The Close button of Modal Popup is implemented using the Close event handler inside which the dialog function is called with parameter value passed as close.
@model jQuery_Modal_Core_Razor.Pages.IndexModel
    Layout = null;
<!DOCTYPE html>
    <meta name="viewport" content="width=device-width" />
    <input type="button" id="btnModalPopup" value="Show Modal Popup" />
    <div id="modal_dialog" style="display: none">
        This is a Modal Background popup
    <script type="text/javascript" src=""></script>
    <link rel="stylesheet" href="" />
    <script type="text/javascript" src=""></script>
    <script type="text/javascript">
        $("#btnModalPopup").on("click", function () {
                title: "jQuery Modal Dialog Popup",
                buttons: {
                    Close: function () {
                modal: true
ASP.Net Core Razor Pages: jQuery Modal Popup example