473,587 Members | 2,496 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Forms Authentication question in web.config

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

<script src="<%# Request.Applica tionPath%>/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="Syst em.Web.UI"
assembly="Syste m.Web.Extension s, Version=3.5.0.0 , Culture=neutral ,
PublicKeyToken= 31BF3856AD364E3 5"/>
<add tagPrefix="asp" namespace="Syst em.Web.UI.WebCo ntrols"
assembly="Syste m.Web.Extension s, Version=3.5.0.0 , Culture=neutral ,
PublicKeyToken= 31BF3856AD364E3 5"/>
<add namespace="Ajax ControlToolkit" assembly="AjaxC ontrolToolkit"
tagPrefix="ajax Toolkit"/>
</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.
<authenticati on mode="Forms">
<forms loginUrl="Login .aspx"/>
</authentication>
<authorizatio n>
<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_Theme s">
<system.web>
<authorizatio n>
<allow users="*"/>
</authorization>
</system.web>
</location>
Aug 25 '08 #1
3 7217
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.Applica tionPath%>/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="Syst em.Web.UI"
assembly="Syste m.Web.Extension s, Version=3.5.0.0 , Culture=neutral ,
PublicKeyToken= 31BF3856AD364E3 5"/>
<add tagPrefix="asp" namespace="Syst em.Web.UI.WebCo ntrols"
assembly="Syste m.Web.Extension s, Version=3.5.0.0 , Culture=neutral ,
PublicKeyToken= 31BF3856AD364E3 5"/>
<add namespace="Ajax ControlToolkit" assembly="AjaxC ontrolToolkit"
tagPrefix="ajax Toolkit"/>
</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.
<authenticati on mode="Forms">
<forms loginUrl="Login .aspx"/>
</authentication>
<authorizatio n>
<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_Theme s">
<system.web>
<authorizatio n>
<allow users="*"/>
</authorization>
</system.web>
</location>
Have you also excluded the scripts folder and any other image folders?

<location path="Scripts">
<system.web>
<authorizatio n>
<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
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.Applica tionPath%>/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="Syst em.Web.UI"
assembly="Syste m.Web.Extension s, Version=3.5.0.0 , Culture=neutral ,
PublicKeyToken= 31BF3856AD364E3 5"/>
<add tagPrefix="asp" namespace="Syst em.Web.UI.WebCo ntrols"
assembly="Syste m.Web.Extension s, Version=3.5.0.0 , Culture=neutral ,
PublicKeyToken= 31BF3856AD364E3 5"/>
<add namespace="Ajax ControlToolkit" assembly="AjaxC ontrolToolkit"
tagPrefix="ajax Toolkit"/>
</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.
<authenticati on mode="Forms">
<forms loginUrl="Login .aspx"/>
</authentication>
<authorizatio n>
<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_Theme s">
<system.web>
<authorizatio n>
<allow users="*"/>
</authorization>
</system.web>
</location>

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

<location path="Scripts">
<system.web>
<authorizatio n>
<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
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.Applica tionPath%>/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="Syst em.Web.UI"
assembly="Syste m.Web.Extension s, Version=3.5.0.0 , Culture=neutral ,
PublicKeyToken= 31BF3856AD364E3 5"/>
<add tagPrefix="asp" namespace="Syst em.Web.UI.WebCo ntrols"
assembly="Syste m.Web.Extension s, Version=3.5.0.0 , Culture=neutral ,
PublicKeyToken= 31BF3856AD364E3 5"/>
<add namespace="Ajax ControlToolkit" assembly="AjaxC ontrolToolkit"
tagPrefix="ajax Toolkit"/>
</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.
<authenticati on mode="Forms">
<forms loginUrl="Login .aspx"/>
</authentication>
<authorizatio n>
<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_Theme s">
<system.web>
<authorizatio n>
<allow users="*"/>
</authorization>
</system.web>
</location>

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

<location path="Scripts">
<system.web>
<authorizatio n>
<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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
4809
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms Authentication set up and it worked just fine. Then I realized that I needed to have some pages unsecure. I then created 2 directories. One named Secure and...
1
2505
by: MJ | last post by:
I'm building an application that has a file structure similar to the following: /myapp/user_login.aspx /myapp/user_page_1.aspx /myapp/user_page_2.aspx /myapp/user_page_3.aspx /myapp/admin/admin_login.aspx /myapp/admin/admin_page_1.aspx /myapp/admin/admin_page_2.aspx
11
3556
by: ElmoWatson | last post by:
I tried on the Security newgroup, as well as other places, and haven't gotten an answer yet - - I'm pulling my hair out over this one. I'm trying to get Forms Authentication working.....I can get any requested page to automatically go to the Login.aspx page, AND, the ReturnURL querystring is correct in the address bar, but no matter what, I...
3
4850
by: Kris van der Mast | last post by:
Hi, I've created a little site for my sports club. In the root folder there are pages that are viewable by every anonymous user but at a certain subfolder my administration pages should be protected by forms authentication. When I create forms authentication at root level it works but when I move my code up to the subfolder I get this...
9
4619
by: Hermit Dave | last post by:
Hi, I am making a web application (rather two applications) one which is host and used by customers when they are just browsing through products. The second application resides on a secure server. This is going to hold all account related information for the customers and will also be used for admin The login is implemented using forms...
2
2490
by: Eric | last post by:
I am trying to build an app where the stuff in the root directory is open to all, but anything under the Restricted directory requires you to login and I want to use Forms to do it. I'm having trouble getting the web.config to work properly. First I tried to have a second web.config in the sub directory with authentication and...
0
4211
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas is the author of Designing Microsoft ASP.NET Applications and owner of Access Microsystems. Doug can be reached at doug@accessmicrosystems.com....
5
2863
by: Gavin Stevens | last post by:
I'm trying to figure out the ASP.NET Forms Auth I have 3 or 4 pages i want to allow anonymous access to.. Then I have 5 or 6 pages I placed in another directory in the webproject. These I want to manually authenticate users to provide acess My project has 2 web.config files... the default file <authentication mode="Forms"><forms...
1
1621
by: Sumaira Ahmad | last post by:
Hi, Please help me with this.. I am trying to use Forms Authentication in a sample project. I basically want to have two folders in my application , one in which I store pages that can be accesed without authentication and one which can be accessed only by authenticated users.. In my Anonymous folder: there is a default.aspx - which is...
1
6441
by: n33470 | last post by:
Hi all, We have an asp.net 1.1 app that we're in the process of converting to 2.0. What I'm about to describe runs just great in the 1.1 framework, but does not work in the 2.0 framework. This app uses forms authentication and denies all unauthenticated users. There is a location override in the web.config so that we can open up a...
0
8216
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7974
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6629
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5719
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5395
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3845
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.