views:

803

answers:

2

Hi. I have this on my web.config file:

<authentication mode="Forms">
      <forms loginUrl="login.aspx" defaultUrl="Venues.aspx" />
    </authentication>
    <authorization>
      <deny users="?" />
      <allow users="*" />
</authorization>

I only whant to alow authenticated users to my pages. The problem is the first time that I go to the login page I don't have any images or style on my page. I think this is because I also denied access to the .jpeg .css files. I think I can solve this issue in IIS, but I'm just in Dev. I only have VS 2008 and no IIS.

Is it possible for me to allow access to the imgs dir for the anonymous user in the web.config?!

Thank you!

+1  A: 

I think this is a known bug in Visual Studio - when you're not using IIS, visual studio mistakenly blocks the CSS file on the login page.

See here:
blog post from tomtech999

It should be OK when you run in IIS.

codeulike
thats it! thanks!
Txugo
+4  A: 

You could allow certain directories (directly under <configuration>):

<location path="images">
 <system.web>
  <authorization>
   <allow users="?"/>
  </authorization>
 </system.web>
</location>

Also you would probably need to include WebResource.axd

<location path="WebResource.axd">
 <system.web>
  <authorization>
   <allow users="?"/>
  </authorization>
 </system.web>
</location>
Sam