@page

@model NewModel
@addTagHelper "*, TestAssembly"
@using Microsoft.AspNetCore.Mvc.RazorPages

@functions {
    public class NewModel : PageModel
    {
        public IActionResult OnPost(Customer customer)
        {
            Name = customer.Name;
            return Redirect("~/customers/inlinepagemodels/");
        }

        public string Name { get; set; }
    }

    public class Customer
    {
        public string Name { get; set; }
    }
}

<h1>New Customer</h1>
<form method="post" class="form-horizontal" >
    <div class="text-danger"></div>
    <div class="form-group">
        <label class="col-md-2 control-label">@Name</label>
        <div class="col-md-10">
            <input class="form-control" />
            <span class="text-danger"></span>
        </div>
    </div>
    <div class="form-group">
        <div class="col-md-offset-2 col-md-10">
            <button type="submit" class="btn btn-primary">Save</button>
        </div>
    </div>
</form>
