Partager via


Getting design time rendering of ASP.NET Themes in Expression Web

MikeO on my team asked me what was Expression Web's support for ASP.NET Themes - a great bit of functionality in ASP.NET 2.0 which allows developers to dictate the appearance of controls in a web application using template files with a .skin extension and also using style sheets. I didn't know the answer, so off I toddled to the product manager in Corp, Wayne Smith, who quickly came back with the solution.

So, to test this out I downloaded an ASP.NET Starter Kit from www.asp.net such as the Personal Web Site starter kit which includes ASP.NET Themes in the solution. I installed the project template and created a sample personal web site to see what Expression Web did out of the box with Themes - not much was the answer and I didn't know why:

 

no_aspnet_themes

 

As you can see above - there is no style being applied to the .master page. This is where Wayne and subsequent searching on the web found the solution. To get design time rendering it is *really* simple, just add the following line to your web.config file (the pageBaseType isn't necessary):

 <pages pageBaseType="PageBase" styleSheetTheme="Red" />

And as a result you get this:

aspnet_themes_design

I am assuming that this should also work in Visual Studio but haven't investigated.

MJ

 

tags: asp.net, expression web, themes

Comments

  • Anonymous
    September 21, 2006
    Yes, seems to work in VS and now I know what to search for I can find various references. It still doesn't explain *why" this should work while the theme property doesn't but there's a nice explanation of the difference between the two on Dave Wheeler's blog at http://blogs.effectivexaml.net/DaveWheeler/2005/10/theme-and-stylesheettheme.html. It's funny - I just accepted that VS wouldn't render the page with themes as a given but I was not happy when I thought Expression Web couldn't do it! Nice to know I can have it in both...

  • Anonymous
    September 24, 2006
    PingBack from http://blog.by-expression.com/index.php/aspnet-expressionweb/

  • Anonymous
    January 21, 2007
    Thanks for the link to my solution on design time rendering of themes!! ....Weird I was just watching you on a video from the Vista dev launch!! then spotted this a mass of traffic to my blog from here!!! Had my seat to be there but the wind wrecked my house so could not make it! Steve

  • Anonymous
    January 21, 2007
    The comment has been removed

  • Anonymous
    June 08, 2009
    PingBack from http://cellulitecreamsite.info/story.php?id=10253

  • Anonymous
    June 12, 2009
    PingBack from http://besteyecreamsite.info/story.php?id=2606