Skip to content

Instantly share code, notes, and snippets.

@mikebrind
Created March 19, 2019 05:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikebrind/8bf68b9abc5975d8666788d304fb47c6 to your computer and use it in GitHub Desktop.
Save mikebrind/8bf68b9abc5975d8666788d304fb47c6 to your computer and use it in GitHub Desktop.
@page
@model RazorPartialToString.Pages.ContactModel
@if(TempData["PostResult"] == null)
{
<form method="post">
<label asp-for="ContactForm.Name"></label>
<div class="form-group">
<input asp-for="ContactForm.Name">
</div>
<label asp-for="ContactForm.Email"></label>
<div class="form-group">
<input asp-for="ContactForm.Email">
</div>
<label asp-for="ContactForm.Subject"></label>
<div class="form-group">
<input asp-for="ContactForm.Subject">
</div>
<label asp-for="ContactForm.Message"></label>
<div class="form-group">
<textarea asp-for="ContactForm.Message"></textarea>
</div>
<label asp-for="ContactForm.Priority"></label>
<div class="form-group">
<select asp-for="ContactForm.Priority" asp-items="Html.GetEnumSelectList<Priority>()">
<option value="">Set Priority</option>
</select>
</div>
<div class="form-group">
<button class="btn btn-sm btn-primary">Submit </button>
</div>
</form>
}
else
{
<p>@TempData["PostResult"]</p>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment