Lets say I'm converting a whole bunch of content pages - dumb HTML - over to MVC model.
I'd want to stick all the plain HTML files in a directory and 'find' them based on a controller.
This kind of appears to be what the 'HomeController' in the standard ASP.NET-MVC is doing, but I have to explicitly add each page.
[HandleError]
public class HomeController : Controller
{
public ActionResult Index()
{
ViewData["Title"] = "Home Page";
ViewData["Message"] = "Welcome to ASP.NET MVC!";
return View();
}
public ActionResult About()
{
ViewData["Title"] = "About Page";
return View();
}
public ActionResult About2()
{
ViewData["Title"] = "About Page 2";
return View();
}
}
I added an About2.aspx page in the 'Home' directory, and had to add an About2 method into the HomeController to enable the URL http://localhost:51234/Home/About2.
But lets say I have 50 HTML pages and I want to find them based on the URL.
How could I achieve that?