title: Creating a Custom Controller Factory in ASP.NET MVC
body: <p>I am looking at an example from a book where the author is trying to create a custom controller factory as follows. 
  (Referring to only the CreateController Method)</p>
  
  <pre><code>public IController CreateController(RequestContext requestContext,  
              string controllerName) { 
  
              Type targetType = null; 
              switch (controllerName) { 
                  case "Product": 
                      targetType = typeof(ProductController); 
                      break; 
                  case "Customer": 
                      targetType = typeof(CustomerController); 
                      break; 
                  default: 
                      requestContext.RouteData.Values["controller"] = "Product"; 
                      targetType = typeof(ProductController); 
                      break; 
              } 
  
              return targetType == null ? null : 
                  (IController)DependencyResolver.Current.GetService(targetType); 
          }
  </code></pre>
  
  <p>For the default case, the value of the controllerName default case is being set to an existing controller(Product). The reason being given is that this will cause the MVC framework to search for views associated with out fallback controller and not the controller that the user requested.
  My question is why is it that the views are not searched in the similar way for cases Product and Customer?</p>