title: Asp.Net MVC 3 - How do you Add/Map a view to a project?
body: <p>I created a new MVC 3 project. I ran the project and it loaded the home page. I then added a new view called "discussion.cshtml". </p>
  
  <p>I have 1 controller in the Controllers folder: HomeController  </p>
  
  <p><strong>EDIT</strong> I misspelled Discussion before but it's not misspelled in my project. the problem persists.  </p>
  
  <p>the new view is setup in this fashion: View -> Home -> Discussion.cshtml  </p>
  
  <p>I added this code to the HomeController</p>
  
  <pre><code> public ActionResult Discussion()
           {
               return View();
           }
  </code></pre>
  
  <p><strong>Problem:</strong> The view did not load when I hit run. I got the 404 error. The index page loads with this url "localhost:5553". But I tried <code>"localhost:5553/discussion.cshtml"</code> and it can't find it. How do I map/route to a view. I'm not sure what's going on, I feel like I'm missing something simple.</p>
  
  <p>The Global.ascx page has the usual default code if it helps:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.Mvc;
  using System.Web.Routing;
  
  namespace MvcApplication1
  {
      // Note: For instructions on enabling IIS6 or IIS7 classic mode, 
      // visit http://go.microsoft.com/?LinkId=9394801
  
      public class MvcApplication : System.Web.HttpApplication
      {
          public static void RegisterGlobalFilters(GlobalFilterCollection filters)
          {
              filters.Add(new HandleErrorAttribute());
          }
  
          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
              );
  
          }
  
          protected void Application_Start()
          {
              AreaRegistration.RegisterAllAreas();
  
              RegisterGlobalFilters(GlobalFilters.Filters);
              RegisterRoutes(RouteTable.Routes);
          }
      }
  }
  </code></pre>