Form Authentication and page problems with wcsf

Topics: User Forum
Feb 19, 2007 at 1:21 AM

I am writing a web application using wcsf. I added this snippet in my web.config file and I am noticing strange behaviors

<authentication mode="Forms">
<forms loginUrl="Login.aspx" name=".ASPXFORMSAUTH" path="/"/>

<deny users="?"/>

What happens is this -
a) User is redirected to login.aspx page
b) Login.aspx page looses all its CSS => no formatting. Contents are intact though.
c) Displays javascript errors and I guessing it is because of some path problem on redirect

I even created a very simple application and the behavior is same.

Would really appreciate your help.

Regards & thanks

Feb 19, 2007 at 8:43 AM
My guess is that you will see this issue even if you're not using the Web Client Factory - i.e. if you're using vanilla ASP.NET 2.0.

It is usually because your users do not have permission to your images/themes/javascript directories. Remember that the <deny users="?" /> line prevents anon users from accessing any of your site.

To allow anon users access to your themes and javascript (assuming this has no knock-on security implications in your particular application) you can put another web.config file in the "App_Themes" directory and others, containing the following;

<?xml version="1.0"?>
<allow users="*" />

(excuse the formatting... I suspect the indentation will be lost)

Hope that helps.

Feb 20, 2007 at 3:27 PM
Thanks Simon. Your suggestions worked.