Skip to content

Instantly share code, notes, and snippets.

Jorge Levy KodiakMx

  • Roseville, CA
Block or report user

Report or block KodiakMx

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@KodiakMx
KodiakMx / profiles.json
Last active Oct 18, 2019
Windows Terminal profile json
View profiles.json
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"profiles": [
{
// Make changes here to the Visual Studio Terminal profile
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6102}",
View ModelListBinding.Index2.cshtml
@Html.TextBoxFor(m => m[i].LastName, new { @class="form-control" })
View ModelListBinding.Person.cs
public class Person
{
public int id { get; set; }
[Display(Name = "First Name")]
public string FirstName { get; set; }
[Display(Name = "Last Name")]
public string LastName { get; set; }
View ModelListBinding.Index.cshtml
@model List<ModelListBinding.Models.Person>
<form asp-action="Save" method="post" role="form">
<table>
<thead>
<tr>
<th><label asp-for="@Model[0].FirstName" class="control-label"></label></th>
<th><label asp-for="@Model[0].LastName" class="control-label"></label></th>
<th><label asp-for="@Model[0].Birthday" class="control-label"></label></th>
<th><label asp-for="@Model[0].IsActive" class="control-label"></label></th>
View ModelListBinding.HomeController.Save.cs
[HttpPost]
public IActionResult Save(List<Person> model)
{
//Manipular datos
return View(model);
}
@KodiakMx
KodiakMx / ModelListBinding.HomeController.cs
Last active Oct 4, 2019
Model List Binding - Controller code
View ModelListBinding.HomeController.cs
public IActionResult Index()
{
List<Person> model = new List<Person>()
{
new Person() { id = 1, FirstName = "Jorge", LastName = "Levy", Birthday = new DateTime(1977, 3, 10), IsActive = true },
new Person() { id = 1, FirstName = "Maria", LastName = "Gutierrez", Birthday = new DateTime(1977, 1, 1), IsActive = true },
new Person() { id = 1, FirstName = "Samanta", LastName = "Lopez", Birthday = new DateTime(1980, 1, 1), IsActive = false },
new Person() { id = 1, FirstName = "Pedro", LastName = "Paramo", Birthday = new DateTime(1998, 12, 24), IsActive = false },
};
View HelloWord.cs
public class HomeController : BaseController
{
public IActionResult Index()
{
return View("Hola Mundo!!!");
}
}
You can’t perform that action at this time.