Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ViewData["list"] = db.Users.ToList();
- public class MyClassController : Controller
- {
- private ProjectContext db = new ProjectContext();
- //
- // GET: /MyClass/
- public ViewResult Index()
- {
- return View(db.MyClasses.ToList());
- }
- }
- @model IEnumerable<MvcApplication1.Models.MyClass>
- @foreach (var item in Model) {
- <div>
- <!-- HTML here like @item.Title -->
- </div>
- }
Add Comment
Please, Sign In to add comment