0

I am using asp.net built in authentication and cannot display images on the built-in login.aspx page before logging in. I've tried adding the following block of code in Web.config as suggested in this post: Unauthenticated users can't see images in website

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

I also tried

<location path="Content/Images">

and

<location path="Content">

but none of them worked.

Community
  • 1
  • 1
alegz
  • 133
  • 1
  • 13
  • I think you need to allow for anonymous users: http://stackoverflow.com/questions/10351075/allow-anonymous-authentication-for-a-single-folder-in-web-config – PhilDulac May 06 '16 at 16:39
  • I've tried allowing both anonymous and all users, but neither works. – alegz May 07 '16 at 10:32

1 Answers1

0

My problem was I used a HTML tag:

<img src="Images/myImg.gif"/>

The problem disappeared with the use of Image Web server control:

<asp:Image ID="Image1" runat="server" ImageUrl="Images/myImg.gif"/>
alegz
  • 133
  • 1
  • 13