Forms Authentication question in web.config

M

Mike Collins

I have a web application that I started building. I created a master page
with some javascript in the head:

<script src="<%# Request.ApplicationPath%>/Scripts/Main.js"
type="text/javascript"></script>

I am also using themes and set my default theme in webconfig:

<pages theme="Default">
<controls>
<add tagPrefix="asp" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"/>
<add tagPrefix="asp" namespace="System.Web.UI.WebControls"
assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"
tagPrefix="ajaxToolkit"/>
</controls>
</pages>

After creating the master page, and a default page, I ran the application
and everything was ok. I then added forms authentication and started setting
up security. After adding the forms authentication section, my application
started having javascript errors and stopped showing my images. Can anyone
tell me why this is happening and how to fix it?

--Authentication section in web.config.
<authentication mode="Forms">
<forms loginUrl="Login.aspx"/>
</authentication>
<authorization>
<deny users="?"/>
</authorization>

I did add this section, which got the CSS back to working, but the images
still are not showing, and the javascript is still not working.

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

Leon Mayne

Mike said:
I have a web application that I started building. I created a master page
with some javascript in the head:

<script src="<%# Request.ApplicationPath%>/Scripts/Main.js"
type="text/javascript"></script>

I am also using themes and set my default theme in webconfig:

<pages theme="Default">
<controls>
<add tagPrefix="asp" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"/>
<add tagPrefix="asp" namespace="System.Web.UI.WebControls"
assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"
tagPrefix="ajaxToolkit"/>
</controls>
</pages>

After creating the master page, and a default page, I ran the application
and everything was ok. I then added forms authentication and started setting
up security. After adding the forms authentication section, my application
started having javascript errors and stopped showing my images. Can anyone
tell me why this is happening and how to fix it?

--Authentication section in web.config.
<authentication mode="Forms">
<forms loginUrl="Login.aspx"/>
</authentication>
<authorization>
<deny users="?"/>
</authorization>

I did add this section, which got the CSS back to working, but the images
still are not showing, and the javascript is still not working.

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

Have you also excluded the scripts folder and any other image folders?

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

If you right-click on the missing images and select Properties, what Url
do they display?
 
M

Mike Collins

I did not know I could do that with the scripts or image folders. I'll try
that and get back to you.
 

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

Top