Anonymous access to Theme with Security in web.config

Posted on 2006-04-07
Last Modified: 2008-06-27
Hi all

I have an 2.0 website with 2 themes, red and blue.
Everything works perfect, except for that I want anonymous users can see the default theme (blue).
A user who has logged in can go to the configuration page to choose his/her favorite theme.

Anonymous users don't have access to the default theme.

Here is an extract of my web.config

       <deny users="?" />

    <authentication mode="Forms" />

    <anonymousIdentification enabled="true"/>

        <add name="MyTheme" defaultValue="Blue" allowAnonymous="true"/>

If I omit the deny users="?" it works perfectly but I want users (who are registered) be able to change colors, and anonymous users can only see one default theme, so that the site has a nice structure

Can anyone help me please?


Question by:gerrie_govaerts

    Author Comment

    Found the solution by myself.
    Here comes it for those who are interested

    Set the following in web.config

    First I deny access to all anonymous users

            <deny users="?"/>

    Then I allow identification for anonymous users

          <anonymousIdentification enabled="true"/>

    A profile setting for your favourite theme (on user basis) with a default theme for every anonymous user

              <add name="MyTheme" defaultValue="Blue" allowAnonymous="true"/>

      A location that points to the special 2.0 directory where the themes are managed, set them to be accessible for the anonymous users

      <location path="App_Themes">
            <allow users="?"/>

    This does the job perfectly. Anonymous users can see the default theme (blue in this case) and if they are succesfully logged in they can change this profile setting on an aspx page.

    Accepted Solution

    Because you have presented a solution to your own problem which may be helpful to future searches, this question is now PAQed and your points have been refunded.


    Expert Comment

    Hello Gerrie,

    Just to let you know, I solved the same problem with less steps.

    I did not use these:

    <anonymousIdentification enabled="true"/>

    And now it works.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now