title: MVC Controllers
body: <p>I have my controller working in a way at the moment where the url comes up <code>Home/Collections/Collection?id=1</code> at the moment, which was my intended functionality. However, I would now like to make the url more friendly. For example, I would like it to become <code>Home/Collections/Summer</code>.</p>
  
  <p>I have the following code in my <code>CollectionsController</code>:</p>
  
  <pre><code>    public ActionResult Index()
      {
          return View(Helper.Helper.ResolvePath("Collections"));
      }
  
  
      //
      // GET: /Collections/Collection?id=1
      public ActionResult Collection(int id)
      {
          var collectionModel = ds.GetCollection(id);
          return View(Helper.Helper.ResolvePath("Collection"), collectionModel);
      }
  </code></pre>
  
  <p>What do I need to change to get my desired result? Without having a separate <code>ActionResult</code> for each collection (as it will never be a fixed number)?</p>
  
  <p>And here is my Global.asax</p>
  
  <pre><code>    public static void RegisterRoutes(RouteCollection routes)
      {
          routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
          routes.MapRoute(
              "Default", // Route name
              "{controller}/{action}/{id}", // URL with parameters
              new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
          );
  
      }
  </code></pre>