I added a homecontroller to an application using mvc.
I think it should only work when I type localhost/home
However it works even when I just type localhost
anyone know why?
public class HomeController : Controller
{
//
// GET: /Home/
public ActionResult Index()
{
return Content("Hello world mvc");
// return View();
}
}
It’s down to your routing rules in your Global.ascx.cs file:
You can change
"Home"to a different controller name or remove this line entirely.