473,466 Members | 1,417 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Unable to get login page using master page to display styles with forms authenticatio

2 New Member
I have seen numerous posts with this problem, however none of the solutions have worked for me. I am using asp.net 4.0 forms authentication. I have the following set in my config file.
Expand|Select|Wrap|Line Numbers
  1.     <authentication mode="Forms">
  2.       <forms loginUrl="~/Account/Login.aspx" />
  3.     </authentication>
  4.     <authorization>
  5.       <deny users="?"/>
  6.     </authorization>
The login.aspx page uses a master page and styles in a stylesheet located in a folder off the root directory called 'Styles'. I have also add the following to my config file.
Expand|Select|Wrap|Line Numbers
  1.   <location path="~/Styles">
  2.     <system.web>
  3.       <authorization>
  4.         <allow users = "*"/>
  5.       </authorization>
  6.     </system.web>
  7.   </location>
When the page displays, the login page displays with the master page content, however all of the styles are missing. When I embed styles into the master page the styles show properly, so I know the problem is that the styles are not being accessed from the file.

Does anyone know how I can authorize access to the stylesheet?
Dec 9 '10 #1
2 6007
Frinavale
9,735 Recognized Expert Moderator Expert
Try placing your login page, and the style used for it, outside of the protected content folder...

For example, have a folder within your site called "protected" or something where you have placed all of the pages that require authentication in order to access them.

Place your Login page, and the master page, and the styles outside of the protected folder since everyone can use these resources.

Now, within the protected folder, add a web.config file that states that all unauthorized people should be denied access and redirected to the login page.

In the main root of the site, allow everyone access.

-Frinny
Dec 9 '10 #2
jesposito
2 New Member
Frinny,

Thanks for your help. This solved the problem. Just what I needed!

Jim
Dec 9 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: John | last post by:
Hi I have an existing layout in the form of an html page. I need to turn this into a master page. Are there any step by step instructions to do this eg how do I turn specific areas into master...
0
by: ALGARCIA | last post by:
hi, i have a problem when i return a value from my popup y have master in my parent page and in my popup i don't have one, y have a function like this in the popup page : function...
2
by: news.sbcglobal.net | last post by:
Back in the good old days (or bad old days depending on your point of view) when I used frames to develop some of my web sites, I was able to designate which frame I wanted a page to open in. Now...
0
by: Nick | last post by:
Hi All: I have a web page name it A which has some form parameters for update function , it works perfectly before i merge this page using master page function. Because master page has form...
0
by: mrpage | last post by:
I have developed a page that uses a ASP.Datalist control to display details including images in a database. The page uses parameters passed by links from the home page (i.e, category ID when clicking...
1
by: Rushi | last post by:
Hi All, I want to publish one Event from my Header User Control using Master pAge . And want to attach/detach this event from individual pages. Details: I have one User Control Header.ascx....
4
by: lipsa | last post by:
Dear all, very new to asp.net 2.0.need help urgently. suppose i have 3 pages. page1- textboxname textboxage textboxAddress page2-
1
by: sudip2008 | last post by:
When using the Calendar Popup in a content page of a masterpage the strForName is always set to aspnetForm This breaks this line from working properly window.opener.document.forms...... How can...
1
by: indirareddy | last post by:
Hai ... I Did One Project Without Title . How To Applied Title Name . Note :- I Have Using Master Page it is possible to write title in Default .aspx Example :-
5
by: Murray | last post by:
Forgive me if this question is too basic, but I'm new to ASP.NET programming, and I can't locate a simple answer to this question. I have a web page that consists of a Master Page and a single...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.