Greg Smith said:
I am writing an application in VS2005. I have created two forms and tested
both as the startup page. I changed the web.conf to use Forms based
authentication and defined one as the login page. When the login page comes
up the graphic are now broken.
I did this in VS2003 and it never happened.
Any help is greatly appreciated.
This thread is a little old, however I was having the same issue and could not find any information in the net. I found a fix for my specific problem so decided to post the response here.
Every forms authentication example on the net (all 10000 of them) use just a standard form with no graphics. In my sites main web.config file I set up authentication by adding this. I am verifying users via a database.
<authentication mode="Forms">
<forms name =".FDCAPP" loginUrl="~/login/login.aspx" protection="All" timeout="30" path="/" />
</authentication>
<authorization>
<deny users="?"/>
</authorization>
which I copied from one of those 10000 sites. The authentication works great, the only problem is when it bounces out to the login page the graphics do not render. If you login, then go back to the login page the graphics are there.
what I did to correct this was put my login.aspx page in it's own folder called login. then I added another web.config to that folder with only the following.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<authorization>
<allow users="?" />
</authorization>
</system.web>
</configuration>
this will allow anonymous access to just this folder, which will display the graphics before the user has actually logged in. Seems to work great.