Skip to content

Commit

Permalink
Section 8 - Edit User View
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhrugen Patel committed Sep 6, 2020
1 parent 227dc5f commit ce6dab6
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
34 changes: 34 additions & 0 deletions IdentityManager/Views/User/Edit.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
@model ApplicationUser
<h1 class="text-info">Edit User</h1>

<div class="row">
<div class="col-md-8">
<form method="post" asp-action="Edit">
<input asp-for="@Model.Id" hidden />
<hr />
<div asp-validation-summary="All" class="text-danger"></div>

<div class="form-group">
<label asp-for="Name"></label>
<input asp-for="Name" class="form-control" />
<span asp-validation-for="Name" class="text-danger"></span>
</div>

<div class="form-group">
<label asp-for="Email"></label>
<input asp-for="Email" readonly class="form-control" />
<input asp-for="Email" hidden />
</div>
<div class="form-group">
<label asp-for="RoleId"></label>
<select asp-for="RoleId" asp-items="@Model.RoleList" class="form-control">
<option disabled selected>--Select Role--</option>
</select>
</div>
<div class="form-group">
<button type="submit" class="btn btn-success">Update</button>
<a asp-action="Index" class="btn btn-warning" style="width:auto">Back to User</a>
</div>
</form>
</div>
</div>
11 changes: 11 additions & 0 deletions IdentityManager/Views/User/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,18 @@
@item.Role
</td>
<td>
<div class="text-center">
<form asp-action="Delete" asp-route-userId="@item.Id">
<a asp-action="Edit" asp-route-userId="@item.Id" class="btn btn-info text-white" style="cursor:pointer">
Edit
</a>

<button type="submit" onclick="return confirm('Are you sure you want to delete this?')"
class="btn btn-danger">
DELETE
</button>
</form>
</div>
</td>
</tr>
}
Expand Down

0 comments on commit ce6dab6

Please sign in to comment.