title: ASP.NET Script Include Read Permissions Error
body: <p>I have an ASP.NET MVC App with a Razor page (call it Sample.cshtml) which includes a JS script file in the Head section as follows:</p>
  
  <pre><code>&lt;script src="https://www.example.net/Errors/utils.Version4.js" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>(exact names have been changed to protect the innocent). The application is on a Shared Hosting site and through the site's Control Panel I have set IIS Permissions on the Errors subdirectory to Allow Anonymous Access for SSL and Enable Read Permissions for SSL while I have DISALLOWED Allow Anonymous Access and Enable Read Permissions.</p>
  
  <p>The issue is this: when I log on to my app and Authenticate (using Forms Authentication) and the controller loads Sample.cshtml, the js file cannot be read. If I do a View Source and click the link in the Script tag I see some error HTML that indicates I don't have permission to read the resource, Error Code 403.2. HOWEVER, if I type the src URL into the Address Bar I can download the JS file fine and view the text in my browser. </p>
  
  <p>Why would I have Read Permissions if I use the Address Bar but NOT have read permissions when the src is called from my page script include? I've experimented a bit and if I also check Enable Read Permissions (so that Read Permissions are enabled for both SSL and non-encrypted http) the problem goes away. </p>
  
  <p>I'm sure there's a logical answer that I'm just not sophisticated enough to discern but I'm desperate to fix this (and desperate to learn) so any information would be gratefully received.</p>
  
  <p>Thanks.</p>