By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,220 Members | 1,186 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,220 IT Pros & Developers. It's quick & easy.

Forms Authentication question in web.config

P: n/a
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>
Aug 25 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Mike Collins wrote:
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?

---
Leon Mayne
http://leon.mvps.org
Aug 26 '08 #2

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

"Leon Mayne" wrote:
Mike Collins wrote:
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?

---
Leon Mayne
http://leon.mvps.org
Aug 26 '08 #3

P: n/a
That worked great...both for the scripts and images in my project. Thank you.

"Leon Mayne" wrote:
Mike Collins wrote:
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?

---
Leon Mayne
http://leon.mvps.org
Aug 26 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.