Skip to main content

Theming in Whidbey using CSS

Continuing my blog titled Themes in Whidbey. I would like to mention some great points I did find out today about Whidbey featrures.
How many times have you got sick of developing Sites which have themes????
I mean every page u create has to have, maybe in ASP, something like
<link href="<%=Session["ThemeFile"]%>.css"/>
I have been doing since a long time. Do mention if you have a simpler method of defining a variable CSS for your page!!! Whidbey simplifies this further. Now in ASP.NET, all you will have to do is

  • Create Themes directory, if not aldready present,

  • Create a directory for each theme required, maybe Black, Gray,etc.
    Dump your CSS files into this directory.

  • in Page_PreInit method define the Theme as Page.Theme="<Theme directory Name>". Further can be made into Page.Theme=(string)Session["ThemeType"]


and viola, your theme management is take care by ASP.NET
When you want to change the theme, the string to be passed to the Theme property should be changed. Is'nt that great.

But beware of using the skinId property for any controls. The complexities were aldready mentioned in the other blog.
Anwyay go ahead and play around. Until the next time, happy theming!!!

Comments

Popular posts from this blog

Imagine...an internet based world

Was reading "The Google Story", when i got this wierd idea. Consider a stripped down version of Linux, meant only for doing simple things such as browsing the internet, to read from the various drives (which is primarily meant only for storage of personal data), to play music and some single-player games. All the rest provided by the internet. Information searching/Chatting/Mailing/Documentation editing/journal maintenance/daily schedule maintenance/news/rss/shopping, etc. What else will you use for your computer for? Ok, actually i have been working on mainframes for some time now and am getting adjusted to the "dumb terminal" concept. Then i started associating the concept with scenario we are observing all over the net. As a matter of fact this will reduce the power of processing required on the client side also!!! Looks like the world is changing.... for the bettter, yup, i am sure. technorati tags: New internet age , dumb terminal , internet based world

News Feature

Enough of idle minds' posts. Instead got down to the engines of coding and coded the "Top News Stories", available on the right :D, on the side bar. Initially on load of the page, i was planning to show all the current top stories, accessing it from other sites. But, IE seems to have some security restrictions on a web page accessing resources of other web sites. Ok, i think that's what it is. So it pops up some security message. So i have shifted over to using a textbox and a "Go" button. On the click of the "Go" all the news as per the xml feed in the text box will be displayed. Go ahead and try it, but remember to click "Yes" on the security warning. Anyway for the knowledgeable. On click of the "Go!!!" it uses XmlHttpRequest , retrieves the XML feed from the site mentioned in the text box and displays it in "user friendly" format.

B.O.F.H.

Was browsing the net, and found some old link to BOFH. Not sure as to how many used to read PCQuest some time back when it used to come, but i remember reading them, with of course re-reads and re-re,etc...i can go on you know. Anyway, it's about a system operator who is bugged by no-brainers asking silly computer related queries, and this guy repling with wierd answers. I had never known the origin of this character, until i saw this . Anyway for those who have never read BOFH, here are two of them.