title: How To Change Default View In MVC 4 Web Application
body: <p>By default, MVC 4 in Visual Studio 2017 sets <code>_Layout.cshtml</code> as the default layout for all pages. I believe it's doing this in <code>App_Start/RouteConfig.cs</code>:</p>
  
  <pre><code>routes.MapRoute(
      name: "Default",
      url: "{controller}/{action}/{id}",
      defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
  </code></pre>
  
  <p>(Index is set as the home page) </p>
  
  <p><a href="https://i.stack.imgur.com/scfsu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/scfsu.png" alt="enter image description here"></a></p>
  
  <p>I'm still not sure how Index is getting <code>_Layout.cshtml</code>. But what if I'm trying to set a different view - a login page - as the home page, like this? </p>
  
  <p><a href="https://i.stack.imgur.com/TNljA.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TNljA.jpg" alt="enter image description here"></a></p>
  
  <p>Also I'm trying to get rid of the Reports, Accounts, Settings, and Logout <code>&lt;li&gt;'s</code> in the header so that the page matches the design above. I'll also need a container with a form inside of it. </p>
  
  <p>I've tried creating a <code>_Login</code> view inside of <code>/Home</code> and <code>/Shared</code> and changed <code>"Index"</code> to <code>"Login"</code> in <code>App_Start/RouteConfig.cs</code>: </p>
  
  <pre><code>routes.MapRoute(
  name: "Default",
  url: "{controller}/{action}/{id}",
  defaults: new { controller = "Home", action = "Login", id = UrlParameter.Optional }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/NKV4R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NKV4R.png" alt="enter image description here"></a></p>
  
  <p>But that's giving me an error: </p>
  
  <p><a href="https://i.stack.imgur.com/G2hwP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/G2hwP.png" alt="enter image description here"></a></p>
  
  <p>How can I create a view and set that view as the default view for this MVC 4 Web App? Thanks</p>