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 want to allow 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 styles on my page. I think this is because I denied access to the .jpeg
and .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?
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>
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With