CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Eric Wise

Business & .NET

App Themes and Forms Authentication

So I have wired up the I am Brilliant application to use app_themes.

I would like to say that I'm pretty impressed with the App_Themes concept and I plan on leveraging it soon.  To set a theme at runtime you simply set page.theme="blah" in your pre_init method.

What was driving me crazy was that the login page of my application was not getting the theme so it was showing up all crappy since the css and images were not appearing.  This bothered me greatly for a day or so and then it hit me:

If you want to use themes on a "public page" in a forms authenticated application you have to make sure the App_Themes folder is public.

"Duh" I thought when I figured this out.  But being that themes are new it didn't immediately occur to me.  Quick modification to the web.config fixed me right up:

 

<location path="App_Themes">

<system.web>

<authorization>

<allow users="*"/>

</authorization>

</system.web>

</location>

<location path="images">

<system.web>

<authorization>

<allow users="*"/>

</authorization>

</system.web>

</location>



Comments

parsley said:

Good one, thanks for sharing
# March 28, 2006 8:16 AM

David said:

Very good I was going crazy with that problem...Thanks

# December 31, 2006 1:05 AM

Jesse said:

Thanks so much... this one has been driving me nuts for weeks.  One quick search and viola!  Thanks for the fix...

one note:  This can be simplified by adding a web.config file to the app_theme folder that contains:

<configuration>

   <system.web>

     <authorization>

       <allow users="*"/>

     </authorization>

   </system.web>

</configuration>

# April 5, 2007 10:10 AM

bhavesh makhecha said:

this side is very i . m . p for us

# September 25, 2007 11:13 PM

bhavesh said:

this side is very imp for us

# September 25, 2007 11:14 PM

Gustavo Gonzaga said:

Man, Thanks. This help me a lot !!!!!!!!! I was going crazy with that problem too.

# October 3, 2007 9:33 AM

Jason Lind said:

Great fix, I tried putting a web.config file in App_Theme folder but that didn't work.

# November 30, 2007 7:08 PM

Hillbilly said:

Thanks! This helped me. Almost as good as cheese grits and a bearclaw.

# March 25, 2008 10:19 PM

Jerin said:

Thanks a lot...

# April 2, 2008 11:44 AM

Ervin said:

Thanks alot. I finding this for sometime.

# August 1, 2008 2:53 AM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add
Check out Devlicio.us!

Our Sponsors