6
I have an ASP NET MVC application that is multi-client and multi-user, IE, it is prepared to be used by multiple customers and each client can have multiple users.
Initially the login form has the text input for the client code. However I want to perform some routing for the user to inform the client code directly in the URL, I know that using the standard routing I can get this code taking the value of the parameter id in the controller, but this only works on the first page if some redirect is performed I can’t get this information.
How should I implement this? below my Routeconfig class:
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute("Default", "{controller}/{action}/{id}",
new {controller = "Acesso", action = "Login", id = UrlParameter.Optional});
}
}
Could you put some example? what I understood is that you would like to have some kind of mapping:
{cliente}/{controller}/{action}/{id}
where client is the customer ID for that section.– Tobias Mesquita
This is a very quiet implementation to do, just take care with @Julio security, where someone can go there and exchange this "id"
– Rod