I just created an empty application, added a view, a controller and ran it.
I am getting the following error:
“The resource cannot be found.”
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
My code:
TestController.cs
namespace WOSubmittal.Controllers
{
public class TestController : Controller
{
public ActionResult Index()
{
return View();
}
}
}
View located under Views/Test
Index.cshtml
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
I put a breakpoint to the Index() routine and it doesn’t even get hit. Any ideas?
Change this in
public static void RegisterRoutes(RouteCollection routes)for this:
in your Global.asax.cs