Last active
January 29, 2023 08:28
-
-
Save shaneprice/bc69d6e318b063493948 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#View# | |
<button class="btn btn-primary btn-lg" data-toggle="modal" id="load-partial"> | |
Load partial view | |
</button> | |
<div class="modal fade" id="dynamic-modal"> | |
</div> | |
@section scripts | |
{ | |
<script> | |
$("#load-partial").on('click', function () { | |
console.log('click'); | |
//setup modal | |
$('#dynamic-modal').modal({ | |
keyboard: false, | |
remote: '/home/partial' | |
}).show(); | |
}); | |
$('#dynamic-modal').on('showen.bs.modal', function(e) { | |
console.log('shown'); | |
}); | |
$(function() { | |
}); | |
</script> | |
} | |
#Partial Controller# | |
public ActionResult Partial() | |
{ | |
var list = new List<Guid>(); | |
for (int i = 0; i < 5; i++) | |
{ | |
list.Add(Guid.NewGuid()); | |
} | |
ViewBag.List = list; | |
return PartialView("_MyPartialView"); | |
} | |
#Partial View# | |
<h1>Hola</h1> | |
<div class="modal-header"> | |
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | |
<h4 class="modal-title">Modal title</h4> | |
</div> <!-- /modal-header --> | |
<div class="modal-body"> | |
<ul> | |
@foreach (Guid listItem in ViewBag.List) | |
{ | |
<li>@listItem.ToString()</li> | |
} | |
</ul> | |
</div> <!-- /modal-body --> | |
<div class="modal-footer"> | |
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button> | |
<button type="button" class="btn btn-primary">Save changes</button> | |
</div> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello experts,I want to implement load more button for my website ,https://mrnams.com
Can any one please give idea how to implement load more button to load more videos without refreshing (I mean without loosing loaded videos) page.
Similar to youtube functionality.
I am using .net core 2.1 version