title: How to protect pages in MVC
body: <p>i am new in MVC but worked with web form for a long time. i used to protect pages in webform using location tag. so when any one try to access my product.aspx or SalesReport.aspx then user redirect to login page and after login they can access those pages.</p>
  
  <pre><code>&lt;location path="product.aspx"&gt;
      &lt;system.web&gt;
          &lt;authorization&gt;
              &lt;deny users="*" /&gt;
          &lt;/authorization&gt;
      &lt;/system.web&gt;
  &lt;/location&gt;
  
  &lt;location path="SalesReport.aspx"&gt;
      &lt;system.web&gt;
          &lt;authorization&gt;
              &lt;deny users="*" /&gt;
          &lt;/authorization&gt;
      &lt;/system.web&gt;
  &lt;/location&gt;
  </code></pre>
  
  <p>so in MVC there is no concept like pages rather here we use controller and action method.
  so guide me what people does in mvc to protect private pages through coding and config files</p>
  
  <p>can we  use location tag in mvc if yes then how......give me some sample.</p>
  
  <p>how could i protect full controller and some time want to protect few action method inside the controller.</p>
  
  <p>i guess protection can be done by coding and as well as manipulation config file. so i am looking for two different kind of approach.</p>
  
  <p>so guide me how to protect files through code and how to protect files through manupulating config file like using location tag. thanks</p>