Skip to content

Instantly share code, notes, and snippets.

@wattanar
Last active April 8, 2020 03:40
Show Gist options
  • Save wattanar/2e1a432863e80660c041860be07038de to your computer and use it in GitHub Desktop.
Save wattanar/2e1a432863e80660c041860be07038de to your computer and use it in GitHub Desktop.
Razor Pages Snippets
@page
@model ExampleModel
@{
ViewData["Title"] = "Title";
}
<p class="text-success">@TempData["FormResultSuccess"]</p>
<p class="text-danger">@TempData["FormResultFailed"]</p>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<form asp-page-handler="Handler" method="post">
<div class="form-group">
<label asp-for="Example">Example</label>
<input type="text" asp-for="Example" class="form-control">
<span asp-validation-for="Example" class="text-danger"></span>
</div>
<div class="form-group">
<button type="submit" class="btn btn-success">
<i class="fa fa-check"></i>
Submit
</button>
</div>
</form>
</div>
</div>
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Core.Pages
{
public class ExampleModel : PageModel
{
[TempData]
public string FormResultSuccess { get; set; }
[TempData]
public string FormResultFailed { get; set; }
public void OnGet()
{
}
}
}
<div class="table-responsive">
<table id="gridName" width="100%" class="table table-hover">
<thead>
<tr>
<th>Username</th>
<th>Address</th>
<th>Tel</th>
<th>Country</th>
</tr>
</thead>
</table>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment