How to show images in the Logon Page when Forms Authentication is

Discussion in 'ASP .Net Security' started by GregoryJ, May 7, 2009.

  1. GregoryJ

    GregoryJ Guest

    I have a Logon.aspx web page in my root folder of my web-site. I'm using
    Forms Authentications to authenticate my users. The Forms Authentication
    aspect works fine. The problem I'm having is that my Logon Page needs to
    display some images that are in my /Image folder.

    When the Logon.aspx page loads all images on my Logon.aspx page do not show
    up, even though the URL Links are correct. In design more everything looks
    fine. In fact, if I turn off Forms Authentication the images appear.

    I'm assuming the image files are not accessible because they don't have
    access to them.

    How can I get my logon form to show the images before the user has logged on?

    Thanks.
     
    GregoryJ, May 7, 2009
    #1
    1. Advertising

  2. GregoryJ

    Guest

    What folder/directory contains your logon page? How are you referencing your
    images. In most cases relative paths are used locate the images. I am
    assuming that all your pages in your root folder work fine, but the logon
    page is in a subfolder. In this case you may need to modify the relative
    path to your image folder. If your images are located in an images subfolder,
    you might reference them using the syntax, "~/images/imagefile.jpg". Here
    the "~" is the virtual root of your application.

    Let us know how this works.

    Eagle

    "GregoryJ" wrote:

    > I have a Logon.aspx web page in my root folder of my web-site. I'm using
    > Forms Authentications to authenticate my users. The Forms Authentication
    > aspect works fine. The problem I'm having is that my Logon Page needs to
    > display some images that are in my /Image folder.
    >
    > When the Logon.aspx page loads all images on my Logon.aspx page do not show
    > up, even though the URL Links are correct. In design more everything looks
    > fine. In fact, if I turn off Forms Authentication the images appear.
    >
    > I'm assuming the image files are not accessible because they don't have
    > access to them.
    >
    > How can I get my logon form to show the images before the user has logged on?
    >
    > Thanks.
     
    , May 8, 2009
    #2
    1. Advertising

  3. GregoryJ

    GregoryJ Guest

    RE: How to show images in the Logon Page when Forms Authentication

    Thanks for getting back to me.

    My login.aspx page is in my root folder and my images are in the \images
    folder. I am referencing the images via "~\images\myImage.jpg", but they
    don't show. They appear in design time, but not when running the application.
    Plus, some of my images that aren't displayed are in my MasterPage.master
    file. In the Login page, the images in this file do not appear, but once
    logged in they do appear.

    In my web.config file to implement the Forms Authentication I am denying
    Access to everyone. When that's set, I am forced to login, when it's not set,
    I don't need to login.

    I'm assuming that may have something to do with it?

    Any suggestions on how I should proceed?

    "" wrote:

    > What folder/directory contains your logon page? How are you referencing your
    > images. In most cases relative paths are used locate the images. I am
    > assuming that all your pages in your root folder work fine, but the logon
    > page is in a subfolder. In this case you may need to modify the relative
    > path to your image folder. If your images are located in an images subfolder,
    > you might reference them using the syntax, "~/images/imagefile.jpg". Here
    > the "~" is the virtual root of your application.
    >
    > Let us know how this works.
    >
    > Eagle
    >
    > "GregoryJ" wrote:
    >
    > > I have a Logon.aspx web page in my root folder of my web-site. I'm using
    > > Forms Authentications to authenticate my users. The Forms Authentication
    > > aspect works fine. The problem I'm having is that my Logon Page needs to
    > > display some images that are in my /Image folder.
    > >
    > > When the Logon.aspx page loads all images on my Logon.aspx page do not show
    > > up, even though the URL Links are correct. In design more everything looks
    > > fine. In fact, if I turn off Forms Authentication the images appear.
    > >
    > > I'm assuming the image files are not accessible because they don't have
    > > access to them.
    > >
    > > How can I get my logon form to show the images before the user has logged on?
    > >
    > > Thanks.
     
    GregoryJ, May 8, 2009
    #3
  4. GregoryJ

    GregoryJ Guest

    RE: How to show images in the Logon Page when Forms Authentication

    I just figured out what I'm doing wrong. SInce this is my first web-site that
    I'm pushing out to the web, I realized that I'm treating everything in my web
    application as Secured.

    What I did is I created a folder named "Secured" off of my root folder. In
    this folder I created a web.config file with the [deny users="?"] option set,
    while the root folder web.config file has [allow users="?"]. Thus, now my
    ~/images folder is not a secured location and my login.aspx page has access
    to the image files.

    Thanks.

    "" wrote:

    > What folder/directory contains your logon page? How are you referencing your
    > images. In most cases relative paths are used locate the images. I am
    > assuming that all your pages in your root folder work fine, but the logon
    > page is in a subfolder. In this case you may need to modify the relative
    > path to your image folder. If your images are located in an images subfolder,
    > you might reference them using the syntax, "~/images/imagefile.jpg". Here
    > the "~" is the virtual root of your application.
    >
    > Let us know how this works.
    >
    > Eagle
    >
    > "GregoryJ" wrote:
    >
    > > I have a Logon.aspx web page in my root folder of my web-site. I'm using
    > > Forms Authentications to authenticate my users. The Forms Authentication
    > > aspect works fine. The problem I'm having is that my Logon Page needs to
    > > display some images that are in my /Image folder.
    > >
    > > When the Logon.aspx page loads all images on my Logon.aspx page do not show
    > > up, even though the URL Links are correct. In design more everything looks
    > > fine. In fact, if I turn off Forms Authentication the images appear.
    > >
    > > I'm assuming the image files are not accessible because they don't have
    > > access to them.
    > >
    > > How can I get my logon form to show the images before the user has logged on?
    > >
    > > Thanks.
     
    GregoryJ, May 8, 2009
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eric
    Replies:
    2
    Views:
    1,509
    Tommy
    Feb 13, 2004
  2. =?Utf-8?B?RXZhbiBCYXNhbGlr?=

    Getting windows logon when using forms authentication

    =?Utf-8?B?RXZhbiBCYXNhbGlr?=, May 11, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    571
    =?Utf-8?B?RXZhbiBULiBCYXNhbGlr?=
    May 12, 2005
  3. Brian Muth
    Replies:
    2
    Views:
    3,585
    Brian Muth
    Nov 25, 2005
  4. Kjell Kristiansson
    Replies:
    0
    Views:
    294
    Kjell Kristiansson
    Nov 30, 2005
  5. Eric
    Replies:
    2
    Views:
    575
Loading...

Share This Page