-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIndex.cshtml
More file actions
44 lines (37 loc) · 1.22 KB
/
Index.cshtml
File metadata and controls
44 lines (37 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
@{
ViewBag.Title = "List Example";
}
@model WebApp.MVC.Models.ListExampleModel
@using (Html.BeginForm())
{
<script>
$(function () {
// Controller UserListメソッドでパーシャルビューを返す
$.ajax({
type: "POST",
url: "/AjaxExample/PartialUserListView",
data: $(this).serialize(),
success: function (data) {
// パーシャルビューをセット
$("#userListLoader").css("display", "none");
$("#userList").html(data);
},
error: function (jqXHR, status, error) {
console.error(error);
console.error(status);
}
});
});
</script>
<div style="padding:1em;">
<div id="userListLoader">
<div class="d-flex justify-content-center">
<div class="spinner-border" role="status">
<span class="visually-hidden">Loading...</span>
</div>
</div>
</div>
<div id="userList"></div>
</div>
<input type="submit" value="送信" class="btn btn-primary" />
}