what you need to do is
Add a controller Customer
public class CustomerController : Controller
{
//
// GET: /Customer/
public ActionResult Default(string id)
{
if (string.IsNullOrEmpty(id))
return View("SiteIndex"); //default View for you site like home/index here
//put your code to check the customer in the DB here
return View();
}
}
in the Route.Config. add the route for customer before the default one.
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "CustomerDefault",
url: "{id}",
defaults: new { controller = "Customer", action = "Default", id = UrlParameter.Optional }
);
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}