Click here to Skip to main content
15,890,579 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When i am adding the authorization in web.config file, styles like, table background Image,Font etc are not showing in the Login Page. If i comment the authorization then it is working.

following is the Background Image style code

style="background-image:url('Images/BgColor.png')"

Below is the Authentication Code.

XML
<authentication mode="Forms">
      <forms loginUrl="Login.aspx"
             protection="All"
             timeout="30"
             name=".ASPXAUTH"
             path="/"
             requireSSL="false"
             defaultUrl="default.aspx"
             slidingExpiration="true"
             cookieless="UseDeviceProfile"
             enableCrossAppRedirects="false" />
    </authentication>
    <authorization>
      <deny users="?" />
    </authorization>
Posted

Your images and/or stylesheet are probably being denied when the browser requests them. (because it looks like your web.config is set to deny everything)

Try adding something similar to this to your web.config:

XML
<location path="images">
  <system.web>
    <authorization>
      <allow users ="*"/>
    </authorization>
  </system.web>
</location>
 
Share this answer
 
if i am removing
XML
<deny users="?" />
and adding <allow users ="*"/> it is working, but the problem is if anybody is using the URL of other pages without loging it won't redirect to login page.
 
Share this answer
 
Comments
Nathan St 8-Oct-10 5:59am    
That's why you need to add the <location> tag I described above - you need to allow access to the images and stylesheet but continue to require authentication for the aspx pages.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900