Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > Visual Web Developer 2005
|
Visual Web Developer 2005 Discuss creating ASP.NET 2.0 sites with Microsoft's Visual Web Developer 2005. If your question is more specific to a piece of code than the Visual tool, see the ASP.NEt 2.0 forums instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Web Developer 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 21st, 2011, 05:51 AM
Authorized User
Points: 410, Level: 7
Points: 410, Level: 7 Points: 410, Level: 7 Points: 410, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 72
Thanks: 17
Thanked 0 Times in 0 Posts
Unhappy Membership - Css doesn't get applied to login page

Hi,

I have started making a very simple login system. I have created a Login page & also a Css. I have applied the Css to Login Page. I have also created rules that only the authenticated users can enter the site or else they will be redirected to Login page.

When i run the default.aspx page directly without logging, it redirects me to the Login page which is ok, but the style sheet is not getting applied to Login page all colors are vanished & i can see just plain text.

I applied it in this way :-
<link href="Style.css" rel="stylesheet" type="text/css" />

The code seems to be correct. The sytle sheet also is correct as it works in all other pages, then why doesn't it get applied to login page.

Help Me Please.

Thanks....!!
 
Old September 21st, 2011, 06:26 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Are you blocking access to all pages in your site? If so, access to the style sheet is blocked as well.

Add a <location> element to the root of your config file and set its path to your style sheet file or folder. Then set up security to allow anonymous users to access that content.

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
anup.maverick (September 21st, 2011)
 
Old September 21st, 2011, 06:52 AM
Authorized User
Points: 410, Level: 7
Points: 410, Level: 7 Points: 410, Level: 7 Points: 410, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 72
Thanks: 17
Thanked 0 Times in 0 Posts
Default

Hi,

Wow..It works. I added the following code in my web.config file:-

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

Thank U....!!





Similar Threads
Thread Thread Starter Forum Replies Last Post
questions on Membership and auto login markpisc BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 6 March 26th, 2009 10:40 AM
Custom Membership Provider and Login Control sonishpaul ASP.NET 2.0 Professional 2 December 14th, 2007 02:36 PM
CSS not get applied in CR Export functionality skdevre Crystal Reports 0 April 10th, 2007 02:38 AM
Using Access Databases for Login and Membership rodgerpb ASP.NET 2.0 Basics 0 November 19th, 2006 05:58 PM
Simple ASP.NET Membership Provider Login jumpseatnews ASP.NET 2.0 Basics 0 July 16th, 2006 10:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.