committed by
GitHub
5 changed files with 112 additions and 2 deletions
@ -0,0 +1,23 @@ |
|||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
|
||||
|
namespace Microsoft.eShopWeb.ViewModels |
||||
|
{ |
||||
|
public class RegisterViewModel |
||||
|
{ |
||||
|
[Required] |
||||
|
[EmailAddress] |
||||
|
[Display(Name = "Email")] |
||||
|
public string Email { get; set; } |
||||
|
|
||||
|
[Required] |
||||
|
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] |
||||
|
[DataType(DataType.Password)] |
||||
|
[Display(Name = "Password")] |
||||
|
public string Password { get; set; } |
||||
|
|
||||
|
[DataType(DataType.Password)] |
||||
|
[Display(Name = "Confirm password")] |
||||
|
[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] |
||||
|
public string ConfirmPassword { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,55 @@ |
|||||
|
@using System.Collections.Generic |
||||
|
@using Microsoft.AspNetCore.Http |
||||
|
@using Microsoft.AspNetCore.Http.Authentication |
||||
|
@model RegisterViewModel |
||||
|
@{ |
||||
|
ViewData["Title"] = "Register"; |
||||
|
} |
||||
|
<div class="brand-header-block"> |
||||
|
<ul class="container"> |
||||
|
<li class="active" style="margin-right: 65px;">Already have an account? <a asp-action="Signin">LOGIN</a></li> |
||||
|
</ul> |
||||
|
</div> |
||||
|
<div class="container account-login-container"> |
||||
|
<div class="row"> |
||||
|
<div class="col-md-12"> |
||||
|
<section> |
||||
|
<form asp-controller="Account" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal"> |
||||
|
<div asp-validation-summary="All" class="text-danger"></div> |
||||
|
<div class="form-group"> |
||||
|
<label asp-for="Email" class="col-md-2 control-label"></label> |
||||
|
<div class="col-md-10"> |
||||
|
<input asp-for="Email" class="form-control" /> |
||||
|
<span asp-validation-for="Email" class="text-danger"></span> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label asp-for="Password" class="col-md-2 control-label"></label> |
||||
|
<div class="col-md-10"> |
||||
|
<input asp-for="Password" class="form-control" /> |
||||
|
<span asp-validation-for="Password" class="text-danger"></span> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label asp-for="ConfirmPassword" class="col-md-2 control-label"></label> |
||||
|
<div class="col-md-10"> |
||||
|
<input asp-for="ConfirmPassword" class="form-control" /> |
||||
|
<span asp-validation-for="ConfirmPassword" class="text-danger"></span> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<button type="submit" class="btn btn-default btn-brand btn-brand-big"> REGISTER </button> |
||||
|
</div> |
||||
|
<p> |
||||
|
Note that for demo purposes you don't need to register! Use the credentials shown below the |
||||
|
<a asp-action="signin">login screen</a>. |
||||
|
</p> |
||||
|
</form> |
||||
|
</section> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
@section Scripts { |
||||
|
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } |
||||
|
} |
||||
Loading…
Reference in new issue