I am working on razor page asp.net. The problem I'm facing is that I can't display user details using mouse or popup without using boot mode
What I do is as follows
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#userDetailsModal"> View User Details </button>
Modal bootstrap for displaying user details
<div class="modal fade" id="userDetailsModal" tabindex="-1" role="dialog" aria-labelledby="userDetailsModalLabel" aria-hidden="true"> <div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="userDetailsModalLabel">User Details</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <p><strong>User Name:</strong> @TempData["UserName"]</p> <p><strong>User Role:</strong> @TempData["UserRole"]</p> <p><strong>Environment:</strong> @TempData["Environment"]</p> <p><strong>User ID:</strong> @TempData["UserId"]</p> <p><strong>StatusCode:</strong> @TempData["StatusCode"]</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> </div> </div> </div> </div>
I passed the user details using temporary data in the model to see the data and the data was passed successfully
Image of what I expect to do:
Update post
Can you apply a popup for the attached sample code
From your code, you are using
Boostrap 4
mode to display the data, but now Asp.Net Core usesBoostrap 5
. There are some differences in the code betweenBoostrap 4
andBoostrap 5
, you can update the code to: