I'm building a website for multiple organizations. For example, people could go to mydomain.com/org1/home/index or mydomain.com/org2/home/index.
What I am trying to do is have the following routing,
mydomain.com/{area}/{controller}/{action}/{id}
I can't figure out how to do this, and frankly not even sure how to even start setting up my routing. I want to be able to access {area} string in order to decide which images to display, what text etc.
I hope I'm making sense with what I'm trying to do.
routes.MapRoute(
name: "Default",
url: "{area}/{controller}/{action}/{id}"
defaults: new {
controller = "Home",
action = "Index",
id = UrlParameter.Optional,
area = UrlParameter.Optional
);
Your Home controller will look something like this:
public ActionResult Index(string area, string id)