Possible Duplicate:
Url routing with database lookup?
I am looking to build a CMS, This will mean that the user can add pages to the system, this will invlolve entering the URL and then the content as HTML in a Rich text editor.
How will MVC3 routing handle this? as I understand the Controller/Action
method hits an action and returns a View()
but if this URL Controller/Action
exists in a database and points to content in a database
Basically I need the system to check if the route exists if not get the html from the database and display the View()
e.g. /Account/EditUser
In my controller I have
public ActionResult EditUser(){
return View();
}
public ActionResult LoadCMS(String URL){
// check URL exists in DB
// get the html from db
// return the Html as a View to the user
// if not exists then return error page
}
But what do I do when I request a CMS page:
e.g. /Account/DisplayUser
in my controller there is no DisplayUser Action so go to LoadCMS Sorry I have no idea where to start on this so I have no code to give.
Any help or direction would be appreciated.
Thanks