简体   繁体   中英

How can I specify that ASP.NET themes should not be applied to a specific folder?

I happen to have an ASP.NET 2.0 project that I want to apply a site-wide theme to. As such, I've specified the theme in the web.config file by setting the "theme" attibute of the system.web.pages element.

Now, I've added a new folder containing third-party code that I do not wish to apply the theme to (in fact, I can't, because many of the third party pages do not have the head runat="server" tag as required by the ASP.NET theming system). Is there a way to specify a folder that should be excluded from the theme from within the web.config file, without having to alter any of the third-party pages?

You can override this with a page directive theming =false

alternatively, place a web config file in the folder, this will apply for that folder only.

This should demonstrate for you

http://www.aspdotnetfaq.com/Faq/how-to-apply-different-configuration-settings-in-web-config-to-specific-pages-and-folders-in-asp-net-website.aspx

Just an idea (that I have never tried):

maybe it's possible by using a location element in web.config, eg:

<system.web>
    <pages theme="MyTheme">
    ..
</system.web>
<location path="~/3rdPartyPages">
    <system.web>
        <pages theme=""></pages>
    </system.web>
</location>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM