Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS not loading from App_Themes

Tags:

css

asp.net

I am having problem while loading the CSS file through App_Themes folder, I am setting the theme of the page dynamically using code behind by OnPreInit Event and every thing goes fine ie the skin loads perfectly but the corresponding CSS to that specific theme is not loading any help from you will be very much appreciated.

Note: I am loading pages to Iframe.

like image 455
Maxymus Avatar asked Jul 23 '26 18:07

Maxymus


2 Answers

You may need to allow anonymous access to your theme in your web.config file, particularly if you are using Visual Studio's Development Server instead of IIS.

<location path="App_Themes/YourThemeFolder">
    <system.web>
      <authorization>
        <allow users="*"/>
      </authorization>
    </system.web>
</location>
like image 145
Kara Avatar answered Jul 25 '26 08:07

Kara


Add this to your Web.config

<pages styleSheetTheme="YourThemeName"> 
</pages>
like image 21
rtp Avatar answered Jul 25 '26 09:07

rtp



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!