Multi-tenant application with asp.net webforms and routes

3

I'm developing a multi-client Web application for a SaaS and would like each client to have a different URL for access to their area in the application, for example:

link link

I thought about creating an application for each client in IIS, but this, in addition to being costly, could degrade webserver performance (I believe).

Is there any way to do this using routes?

    
asked by anonymous 16.06.2014 / 16:15

1 answer

1

You need to change your route:

routes.MapRoute(
    name: "Default",
    url: "{cliente}/{controller}/{action}/{id}",
    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);

And retrieve the value in the controller

public ActionResult Index(string cliente)
{
    return View(cliente);
}
    
29.06.2014 / 14:57