title: IIS is forcing me to login in order to load my CSS and Javascript files when using Windows Authentication on a subdirectory
body: <p>I have an asp.net MVC application that has one section <code>/admin</code> locked down via windows authentication. I have achieved this by doing the following. </p>
  
  <p><strong>Web.Config</strong></p>
  
  <pre><code>&lt;authentication mode="Windows" /&gt;
  </code></pre>
  
  <p><strong>AdminController</strong></p>
  
  <pre><code>[Authorize]
  public class ContactController : Controller
  {
     ....
  }
  </code></pre>
  
  <p>This works as it should. When I try to access the <code>/admin</code> URI it prompts me for a windows login. </p>
  
  <p><strong><em>However</em></strong>, in my <code>/Views/Admin/Index.aspx</code> view, I am linking to two files:</p>
  
  <pre><code>&lt;script src="/media/js/site.js"&gt;&lt;/script&gt;
  &lt;style href="/media/css/styles.css" ... /&gt;
  </code></pre>
  
  <p>For some reason IIS is prompting me for a windows login for each of these files too. </p>
  
  <ul>
  <li>If I hit cancel (after the first
  login), then the page loads, but
  without any CSS or Javascript. </li>
  <li>If I
  remove those tags from my view, then
  I am only prompted to login one time
  and it "works".</li>
  </ul>
  
  <p>So why is windows prompting me to authenticate for the CSS &amp; JS files?</p>
  
  <p>Any help would be greatly appreciated.</p>