@page
@model RazorPagesBootstrapPopoverDemo.PopoverModel
@{
ViewData["Title"] = "Popover";
Layout = null;
}
<ul class="list-group">
@foreach(var message in Model.Messages)
{
<li class="list-group-item">@message</li>
}
</ul>
public class PopoverModel : PageModel
{
public List<string> Messages { get; set; }
public void OnGet()
{
Messages = new List<string>()
{
"Turns out NASA can't even improve on duct tape... Duct tape is magic and should be worshipped.",
"How come Aquaman can control whales? They're mammals! Makes no sense.",
"As with most of life's problems, this one can be solved by a box of pure radiation."
};
}
}
<script type="text/javascript">
$.ajax({
url: '/popover',
success: function (result) {
$('#popoverNavLink').popover({
content: result,
trigger: 'click',
html: true,
animation: false
})
}
});
</script>