Broken graphics on login page

G

Greg Smith

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.
 
P

Peter Rilling

Right-click on the images in IE and select properties. Look at the location
of the images. Then compare this to where your images are actually at.
This might help you figure out what is happening?
 
G

Greg Smith

Right-click on the images in IE and select properties. Look at the
location of the images. Then compare this to where your images are
actually at. This might help you figure out what is happening?

No difference, but thank you for your response.
 
G

Guest

Greg,
As Peter R. suggested, there are a lot of ways to refer to images in
ASP.NET. If you can request the image via an HTTP call from your browser,
e.g.,
http://myserver/myapp/images/myimage.gif
then you will at least be able to determine what works.
you can use relative or absolute paths for images, as well as the tilde
character in asp.net controls to reference "from the root of the app", e.g.
"~/images/myimage.gif".
Hope that helps.
Peter
 
G

Greg Smith

Thank you for your response Peter.

I have tried all of the techniques that you have suggested and the results
are the same. The page can be displayed just fine if called from the app
but if I use it or any other page as a login page by adding:

<authentication mode="Forms">
<forms loginUrl="login.aspx" name="Scheduler" timeout="1" />
</authentication>

<authorization>
<deny users="?" />
</authorization>

to the web.config file then the graphics break.

Any other thoughts?
 
Joined
Aug 25, 2006
Messages
1
Reaction score
0
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top