title: ASP.NET MVC - Is returning different views from a single controller action a bad idea?
body: <p>I am working on an ASP.NET MVC project were I am using routing to produce friendly URLs and have an issue I am not sure how best to solve.</p>
  
  <p>The routing I have setup work like the following</p>
  
  <p>{category}</p>
  
  <p>{category}/{manufacturer}</p>
  
  <p>{category}/{manufacturer}/{product}</p>
  
  <p>The problem I have is that I want to display matches to the same route in differing ways. e.g.</p>
  
  <p>Category1 Displays</p>
  
  <ul>
  <li>A Description followed by</li>
  <li>An Image followed by a</li>
  <li>List of Products</li>
  </ul>
  
  <p>Category2 Displays</p>
  
  <ul>
  <li>An Image followed by</li>
  <li>Promotions followed by a</li>
  <li>Description</li>
  </ul>
  
  <p>I have got round this by having an enum ViewTemplate associated with the category and then return the view with the same name, but this doesn't feel right, firstly because I'm not sure I should be logic like this in the controller action and also I am still making the same database calls which is fine for some stuff but if a category has 500 products I am still pulling them out the database even for the Category2 when they won't be used. Now to the point:</p>
  
  <ol>
  <li>Is return different views from the same controller action wrong?</li>
  <li>How would you deal with loading different data for each view?</li>
  <li>If I am wrong (which I think I am) How should I be doing something like this?</li>
  </ol>
  
  <p>Thanks for any help you could be.</p>