Files
studenthousedashboard/StudentHouseDashboard/WebApp/Pages/Register.cshtml

36 lines
1.1 KiB
Plaintext

@page
@using Models;
@model WebApp.Pages.RegisterModel
@{
ViewData["Title"] = "Register";
}
<h1>@ViewData["Title"]</h1>
@if (ViewData["confirm"] != null)
{
<div class="alert alert-primary" role="alert">
@ViewData["confirm"]
</div>
}
<form method="post">
@if (HttpContext.User.IsInRole("ADMIN") || HttpContext.User.IsInRole("MANAGER"))
{
@: <div class="mb-3">
<label asp-for="MyUser.Role" class="form-label">Role: </label>
<select asp-for="MyUser.Role" asp-items="Html.GetEnumSelectList<UserRole>()">
<option>Please select a role</option>
</select>
@: </div>
}
<div class="mb-3">
<label asp-for="MyUser.Name" class="form-label">Name: </label>
<input asp-for="MyUser.Name" class="form-control" />
</div>
<div class="mb-3">
<label asp-for="MyUser.Password" class="form-label">Password: </label>
<input asp-for="MyUser.Password" class="form-control" />
</div>
<input type="submit" value="Submit" class="btn btn-primary" />
</form>