chobo
chobo

Reputation: 32291

App_theme not adding styles to web page

I have a web site project that uses an App_theme folder for styles. When I run the site the styles are not applied to the site. What is going on?

It works on other developers computers, but they are using a local IIS 7 server whereas I am using the built in Visual Studio IIS. Note - the site is setup using a web site project (not application).

Upvotes: 0

Views: 6794

Answers (4)

user2043956
user2043956

Reputation: 11

make sure the top of the page includes the "theme" attribute, here's an example of the default page

<%@ Page Language="C#" ClientIDMode="Static" Title="Reset Sessions" MasterPageFile="~/site.Master" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="WorkbenchWeb.resetsession" Theme="Theme" StyleSheetTheme="Theme" %>

Upvotes: 1

Alexander
Alexander

Reputation: 1263

Theme is there, i check Init event and theme is in web.config for all pages, however for some reason css under App_Themes are not added to one of the pages. However, for other pages it's ok - added automatically.

Upvotes: 0

Oleks
Oleks

Reputation: 32333

Maybe the problem is in incorrect folder name - ~/App_Themes instead of yours App_theme?

Right click on your website -> Add ASP.NET Folder -> App_Themes; this will add theme folder automatically, and then you will be able to add themes there.

Upvotes: 2

Mikhail
Mikhail

Reputation: 9300

To apply a theme to a WebSite, it is necessary to set the element to the name of the theme, either a global theme or a page theme, as shown in the following example:

<configuration>
    <system.web>
        <pages theme="ThemeName" />
    </system.web>
</configuration>

How to: Apply ASP.NET Themes

Upvotes: 1

Related Questions