title: how to show master/detail modal pop up in asp.net core razor page
body: <p>In my project, the pop-up opens properly, but no data is loaded inside the modal.
  I think the problem is with the script code because in the debug I noticed that OnGetPermissionAsync does not run by pressing the permissionList button</p>
  <p>its my index</p>
  <pre><code>@page &quot;{handler?}&quot;
  @model AccessLevel.Areas.AccessLevel.Pages.AdminPanel.IndexModel
  @{   
  }
  &lt;table class=&quot;table table-striped table-bordered bootstrap-datatable datatable&quot;&gt;
                      
                      &lt;tbody&gt;
                          @foreach (var item in Model.RoleList)
                          {
                              &lt;tr&gt;
                                  &lt;td&gt;@user.RoleTitle&lt;/td&gt;
                                  &lt;td class=&quot;center&quot;&gt;@user.CreateDate&lt;/td&gt;
                                  &lt;td class=&quot;center&quot;&gt;@user.Description&lt;/td&gt;
                                  &lt;td&gt;
                                      &lt;button class=&quot;btn btn-sm btn-dark details&quot; data-id=&quot;@user.Id&quot; data-toggle=&quot;modal&quot; data-target=&quot;#details-modal&quot;&gt;permissionList&lt;/button&gt;
                                      &lt;/td&gt;
                                  
                              &lt;/tr&gt;
  
                          }
  
                      &lt;/tbody&gt;
                  &lt;/table&gt;
  
  
              &lt;div class=&quot;modal fade&quot; tabindex=&quot;-1&quot; role=&quot;dialog&quot; id=&quot;details-modal&quot;&gt;
                  &lt;div class=&quot;modal-dialog&quot;&gt;
                      &lt;div class=&quot;modal-content&quot;&gt;
                          &lt;div class=&quot;modal-header&quot;&gt;
                              &lt;h5 class=&quot;modal-title&quot;&gt;Permission List&lt;/h5&gt;
                              &lt;button type=&quot;button&quot; class=&quot;close&quot; data-dismiss=&quot;modal&quot; aria-label=&quot;Close&quot;&gt;
                                  &lt;span aria-hidden=&quot;true&quot;&gt;&amp;times;&lt;/span&gt;
                              &lt;/button&gt;
                          &lt;/div&gt;
                          &lt;div class=&quot;modal-body&quot;&gt;&lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
  @section scripts{
      &lt;script&gt;
          $(function () {
              $('button.details').on('click', function () {
                  $('.modal-body').load(`/Index/Permission?id=${$(this).data('id')}`);
              });
          })
      &lt;/script&gt;
  }
  </code></pre>
  <p>its my index.cs</p>
  <pre><code>public class IndexModel : PageModel
      {
          private IRoleService roleService;
  
          public IndexModel(IRoleService roleService)
          {
              this.roleService = roleService; 
          }
          public List&lt;AdminRoleListViewModel&gt; RoleList { get; set; }
          public async Task&lt;IActionResult&gt; OnGetAsync()
          {
              RoleList = await roleService.GetRoleListInViewModel();
              return Page();
          }
          public async Task&lt;PartialViewResult&gt; OnGetPermissionAsync(int id)
          {
              
              return Partial(&quot;_RolePermissions&quot;, await roleService.GetRolePermissionsListAsync(id));
          }
      }
  </code></pre>
  <p>its my GetRolePermissionsListAsync</p>
  <pre><code> public async Task&lt;List&lt;RolePermissionsListViewModel&gt;&gt; GetRolePermissionsListAsync(int roleId)
          {
             
                  return await dBContext.RolePermissions.Include(r =&gt; r.FK_Permission).Where(r =&gt; r.FK_RoleID == roleId).Select((r =&gt; new RolePermissionsListViewModel()
                  {
                      Id = r.ID,
                      PermissionTitle = r.FK_Permission.Title,                   
  
                  })).ToListAsync();
              
          }
  </code></pre>
  <p>its my patial _RolePermissions</p>
  <pre><code>@model List&lt;AccessLevel.DTOs.RolePermissionsListViewModel&gt;
  
  @foreach (var permission in Model)
  {
  
  
      &lt;div&gt;
          &lt;span class=&quot;d-inline-block&quot;&gt;title:&lt;/span&gt;&lt;span&gt;@permission.PermissionTitle&lt;/span&gt;
      &lt;/div&gt;
  
  }
  </code></pre>