TheChaseMan's Frenetic SoapBox

Always looking for better ways to do things...

Themes in ASP.NET 2.0

One slick little feature Fritz Onion discussed at the CampSight event was using Themes/Skins. This topic was nothing new for me, but what I had never considered was what Themes in ASP.NET 2.0 do for you, even if you have no intention of "skinning" your Web site. Quite simply, the ease of managing styles with this new feature makes it very elegant and powerful.

For example, I can make a configuration as easy as this...

<!-- Web.Config -->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
            <system.web>

                   <pages theme="Theme1"></pages>

Create a new App_Themes folder that contains a .skin file and a .css file like this...

<! SkinFile.skin -->
<asp:TextBox runat="server" BackColor="Yellow"></asp:TextBox>

<!-- CSS file -->
input
{
  font-family: Tahoma;
  font-size:larger
}

And we end up with the powerful combination of client-side CSS and server-side skinning ability...

I'm sure having yellow text boxes with ridiculous font is very useful to you, but I'm positive that the concept is.  :-)


Digg!

posted on Sunday, September 04, 2005 1:47 PM

Feedback

# re: Themes in ASP.NET 2.0 3/1/2006 12:32 AM Tsui

excuse me

how can I use different themes in one website?

thank u!

# re: Themes in ASP.NET 2.0 3/1/2006 1:40 AM Tsui

OK
I've solved it
c u!