Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Images not displaying on Login screen (ASP.net 2.0 )

Images not displaying on Login screen (ASP.net 2.0 )

Scheduled Pinned Locked Moved ASP.NET
helpquestioncsharpasp-netsecurity
7 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Craig G Fraser
    wrote on last edited by
    #1

    Hi, I have a problem with images no displaying on my login page. The web application is using forms authentication with the login Url set to "Login.aspx". It also denies access for anonymous users. This can be seen in my web.config file below.... Now when i run the app, and am redirected to the login screen, none of the images on the login screen are shown. If however, i remove the from my web.config file then the images are displayed. I assume that this is because by denying anonymous user access that it has no access to the image files in the website ?? If this is the case, how can i display the images on the login page, but still preventing anonymous user access ?? Any help will be greatly appreciated. Craigo

    M 1 Reply Last reply
    0
    • C Craig G Fraser

      Hi, I have a problem with images no displaying on my login page. The web application is using forms authentication with the login Url set to "Login.aspx". It also denies access for anonymous users. This can be seen in my web.config file below.... Now when i run the app, and am redirected to the login screen, none of the images on the login screen are shown. If however, i remove the from my web.config file then the images are displayed. I assume that this is because by denying anonymous user access that it has no access to the image files in the website ?? If this is the case, how can i display the images on the login page, but still preventing anonymous user access ?? Any help will be greatly appreciated. Craigo

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      Hi there, I guess that you got this problem when you are using the ASP.NET built-in development server, and you should not have that when you run your application againts IIS. It seems to me that the built-in server retricts the unauthentocated user to access the image resources of the site, and I'm not sure if we can change the default settings of the ASP.NET development server. As a work around option, you can place the location tag in the web.config file to allow anonymous user to access the image files.

      C 1 Reply Last reply
      0
      • M minhpc_bk

        Hi there, I guess that you got this problem when you are using the ASP.NET built-in development server, and you should not have that when you run your application againts IIS. It seems to me that the built-in server retricts the unauthentocated user to access the image resources of the site, and I'm not sure if we can change the default settings of the ASP.NET development server. As a work around option, you can place the location tag in the web.config file to allow anonymous user to access the image files.

        C Offline
        C Offline
        Craig G Fraser
        wrote on last edited by
        #3

        Hi, Thanx for the prompt reply. Yes you are correct in that I am getting the problem when running with the built in server. Please could you give me an example of how you would use the "location" tag in the web.config file as you have suggested. Craigo

        M 1 Reply Last reply
        0
        • C Craig G Fraser

          Hi, Thanx for the prompt reply. Yes you are correct in that I am getting the problem when running with the built in server. Please could you give me an example of how you would use the "location" tag in the web.config file as you have suggested. Craigo

          M Offline
          M Offline
          minhpc_bk
          wrote on last edited by
          #4

          Craigo, It looks something like:

          <configuration>
          ....
          <location path="Images">
          <system.web>
          <authorization>
          <allow users="*"/>
          </authorization>
          </system.web>
          </location>
          </configuration>

          Here I assume you put the image files in the Images folder, you can also specify a specific image file in the path attribute. For more information, you can see the location element[^]

          C 1 Reply Last reply
          0
          • M minhpc_bk

            Craigo, It looks something like:

            <configuration>
            ....
            <location path="Images">
            <system.web>
            <authorization>
            <allow users="*"/>
            </authorization>
            </system.web>
            </location>
            </configuration>

            Here I assume you put the image files in the Images folder, you can also specify a specific image file in the path attribute. For more information, you can see the location element[^]

            C Offline
            C Offline
            Craig G Fraser
            wrote on last edited by
            #5

            Yes I have the images in an image folder.....thanx very much for youtr help, that works great. Craigo

            M 1 Reply Last reply
            0
            • C Craig G Fraser

              Yes I have the images in an image folder.....thanx very much for youtr help, that works great. Craigo

              M Offline
              M Offline
              minhpc_bk
              wrote on last edited by
              #6

              Glad to hear that :), but I was going to the corner to cry and wonder why I got voted down with 1 :((.

              C 1 Reply Last reply
              0
              • M minhpc_bk

                Glad to hear that :), but I was going to the corner to cry and wonder why I got voted down with 1 :((.

                C Offline
                C Offline
                Craig G Fraser
                wrote on last edited by
                #7

                ha ha....Wasnt me dude...just gave you a big 5

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups