Jason Clark's Blog

Software, Hardware, whatever...

ASP.NET 2.0 Themes/Skins

I've been doing a fair bit of work with ASP.NET 2.0 Themes the past day or two, and I have to say I'm impressed with it.   If you haven't heard about ASP.NET themes yet, they are a nifty new feature in ASP.NET 2 that allows you to quickly create a Skin/Theme structure for your web interface.    You can skin the controls that ship with ASP.NET and your own custom controls.  Skins can programmatic-ally be set on an application and global level, which is great for an application where the user selects their theme.   We took a set of themes we had done for an application and dropped them into our ASP.NET theme folders and within about 10 minutues had it hooked into the application, very cool.

For a good starter tutorial on it check out this one written by Bill Evjen.

Comments

Jeff said:

I like that you can set a style sheet to be dynamically loaded to a page, because that's what skinning is all about. I'm not a huge fan of the per-control .skin file scheme at all.
# March 11, 2005 11:11 AM

Jason Clark said:

Yep, the beauty is it automatically references all of your CSS at the top of the page, so the .skin file could be irrelevant if you just use CSS to control all of the visual and mechanical operations.
# March 11, 2005 11:16 AM

Ron A. Buckton said:

I've been meaning to blog something about this but havent had much time. I recently presented at the Cleveland Area .NET SIG about backporting .NET 2.0 features to 1.1. Working source code for some of what we covered is available at http://www.bennettadelson.com/technicalresources/presentations.aspx. Part of the presentation was on a .NET 1.1 implementation of the Theme/skin features in .NET 2.0, which allowed for themes that are forward-compatible with .NET 2.0 (copy and paste the contents from the .ascx file into a .skin file and your off and running). In addition to .ascx files for skins you can also utilize the .skin extension in a full-trust environment (fun with reflection to get around the UserControlParser's extension verification process).

The sample also covers Membership from Microsoft, Login controls backported by a coworker which he presented, and my implementations of Themes, Validation Groups, Assembly Resources, and Client Callbacks.

Take a peek and let me know if they're helpful. Btw, no warranty's express/implied.
# March 11, 2005 4:53 PM

Jose Flores said:

Hello, sorry if i don't explain well.
I'm using Themes with asp.net 2.0 (Visual Web developer express beta 1) and i have a command field(in a gridview) like this:

<asp:CommandField ButtonType=Image ShowDeleteButton= true DeleteImageUrl="../../../Themes/White/Images/button-delete.gif"/>

My current Theme is "White" but how about if i change the theme to any other?. I have to change "deleteimageurl" too. How can i avoid this?.

Thank you
Saludos.
# March 30, 2005 11:08 AM

ramakrishna said:

fsdfsfsfsfsfs fsfs fs

# July 19, 2007 2:20 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)