<form method="post" action="/SubmitForm">
<label for="name">Name:</label>
<input type="text" id="name" name="name" />
<input type="submit" value="Submit" />
</form>
@model MyWebApp.Models.UserModel
<form asp-action="SubmitForm" method="post">
<label asp-for="Name">Name:</label>
<input asp-for="Name" />
<input type="submit" value="Submit" />
</form>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required placeholder="Enter your email" />
<div class="form-group">
<label for="username">Username:</label>
<input type="text" id="username" name="username" />
</div>
@Html.TextBox("age", null, new { @class = "form-control" })
@Html.TextArea("comments", 4, 40, new { @class = "form-control" })
@model MyWebApp.Pages.Shared.CustomFieldTemplate
<label asp-for="Value"></label>
<input asp-for="Value" />
<input type="hidden" name="csrf_token" value="your_csrf_token_here" />
[Required]
[RegularExpression(@"\w+")]
public string Username { get; set; }