public class HomeController : Controller { private testContext db = new testContext(); List<Table1> thistable = new List<Table1>(); [HttpPost] public ActionResult Index() { thistable = db.Data1.ToList(); ... return View(thistable); } }
@model IEnumerable<AllIndexTables.Models.Table1> <h2>Index</h2> <center> <table> @foreach (var item in Model) { <tr> <td> @Html.TextBoxFor(modelItem => item.Idt) </td> <td> @Html.TextBoxFor(modelItem => item.datetime0) </td> <td> @Html.TextBoxFor(modelItem => item.col1) </td> <td> @Html.TextBoxFor(modelItem => item.col2) </td> <td> @Html.TextBoxFor(modelItem => item.col3) </td> </tr> } </table> </center>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)