title: MVC - Enabling Forms Authentication
body: <p>I have MVC 1.0 app with VS2008.</p>
  
  <p>I have added configuration to web.config but the app crashes
  in the Default.aspx page code behind. Dont know why its loading that page.</p>
  
  <p>I am just uing all the default setup for MVC 1.0.</p>
  
  <p>This is my webconfig. Shouldn't it show my login page with this config????</p>
  
  <p>Malcolm</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
    &lt;system.web&gt;
      &lt;httpHandlers&gt;
        &lt;add path="*" verb="*"
            type="System.Web.HttpNotFoundHandler"/&gt;
      &lt;/httpHandlers&gt;
  
      &lt;!--
          Enabling request validation in view pages would cause validation to occur
          after the input has already been processed by the controller. By default
          MVC performs request validation before a controller processes the input.
          To change this behavior apply the ValidateInputAttribute to a
          controller or action.
      --&gt;
      &lt;identity impersonate="false"/&gt;
      &lt;pages
          validateRequest="false"
          pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
          pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
          userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"&gt;
        &lt;controls&gt;
          &lt;add assembly="System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" /&gt;
        &lt;/controls&gt;
      &lt;/pages&gt;
  
      &lt;authentication mode="Forms"&gt;
        &lt;forms loginUrl="/Account/LogOn" defaultUrl="/Home/Index"&gt;&lt;/forms&gt;
      &lt;/authentication&gt;
  
      &lt;authorization&gt;
        &lt;deny users="?"/&gt;
      &lt;/authorization&gt;
  
    &lt;/system.web&gt;
  
    &lt;location path="Content/Site.css"&gt;
      &lt;system.web&gt;
        &lt;authorization&gt;
          &lt;allow users="*"/&gt;
        &lt;/authorization&gt;
      &lt;/system.web&gt;
    &lt;/location&gt;
  
    &lt;system.webServer&gt;
      &lt;validation validateIntegratedModeConfiguration="false"/&gt;
      &lt;handlers&gt;
        &lt;remove name="BlockViewHandler"/&gt;
        &lt;add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/&gt;
      &lt;/handlers&gt;
    &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>