views:

212

answers:

3

I just setup an out of the box "W2K8 R2 Web" server and installed IIS 7 out of the box. Then I installed the .NET4 framework and ran "aspnet_regiis -i" command.

I created a site using .NET 4.0 Integrated app pool.

I created an MVC application using the default MVC project template, without modifying I compiled the project and deploy the files using (Publish) to the virtual directory.

I can pull the site up, but the styles are missing from the page and for some reason it routing to the /Account/LogOn?ReturnUrl=/

A: 

A snippet from Fredrik Normen http://weblogs.asp.net/fredriknormen/archive/2008/02/07/asp-net-mvc-framework-using-forms-authentication.aspx:

Note: The will still work for CSS files etc. So to enable a css style when we deny anonymouse use to access "files" in our web site, we can add the to make sure CSS files and images etc can be requested.

 <location path="Stylesheet1.css">
<system.web>
  <authorization>
    <allow users="*"/>
  </authorization>
</system.web>   </location>
kmehta
A: 

You have authrorization enabled for all users in root site (or machine level).

Overwrite that in your virtual directory application web.config file.

Lion_cl
A: 

For a new site you need to check the authentication for the Anonymous Authentication.

Right Click "Anonymous Authentication" select "Edit..."

Make sure the "Application pool identity" is selected. It defaults to IUSR for some reason. this should fix your problem.

If not try the attribute without the path attribute, it'll allow everything in the directory of web.config and any sub directories.

Kwan Cheng