Click here to Skip to main content
14,837,944 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am getting a HTTP 404 error in "/Home/Index". If someone could tell me some common MVC HTTP Errors it would be much appreciated.

public class HomeController : Controller
    private testContext db = new testContext();
    List<Table1> thistable = new List<Table1>();
    public ActionResult Index()
        thistable = db.Data1.ToList();
        return View(thistable);

@model IEnumerable<AllIndexTables.Models.Table1>
        @foreach (var item in Model)
                    @Html.TextBoxFor(modelItem => item.Idt)
                    @Html.TextBoxFor(modelItem => item.datetime0)
                    @Html.TextBoxFor(modelItem => item.col1)
                    @Html.TextBoxFor(modelItem => item.col2)
                    @Html.TextBoxFor(modelItem => item.col3)
Updated 2-Feb-15 11:22am

1 solution

404 is page not found - I notice you have a [HttpPost] attribute on your Index action, this means that it will block any HTTP GET requests.

Try removing the [HttpPost] attribute and see if it starts working.
Pranay Rana 3-Feb-15 6:52am
no problem i removed my solution.....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900