Theme support

AsifCh

Regular
Joined
Oct 14, 2003
Messages
59
Location
Islamabad (Pakistan)
Theme(Skins) support

Hi,

Can any body help me to know how to provide the Theme(Skins) Support in the Asp.Net. Currently I am working on a project in Asp.Net and C#, I want to provide the Theme support for the users and i dont have any idea how to do this. Can any one help me to do this.

Thanks
 
Last edited:
Assuming you are not able to wait for the next release of ASP.NET (where *skining* is natively supported), there are two routes you an take. The easier, is to provider multiple stylesheets for the user, and load up the stylesheet the user has choosen. The more robust and involved is building a custom server control that all your controls inherit from. This guy is responsible for determining the theme and the other plumbing. Take a look at the open source asp.net code base. They implement their own skinning engine.
 
TwistedNerve said:
Assuming you are not able to wait for the next release of ASP.NET (where *skining* is natively supported), there are two routes you an take. The easier, is to provider multiple stylesheets for the user, and load up the stylesheet the user has choosen. The more robust and involved is building a custom server control that all your controls inherit from. This guy is responsible for determining the theme and the other plumbing. Take a look at the open source asp.net code base. They implement their own skinning engine.


Hi,
Thanks for your reply. Can you guide me how to load stylesheets dynamically at runtime.

Thanks,
 
You could wrap the link tag in a usercontrol and set the href attribute in your code behind:

Code:
<link rel="stylesheet" type="text/css" href="<%= StyleSheetUrl %>" />

All the code does here, is when the asp.net page parser runs into this section, it will call the property in the code-behind (StyleSheetUrl) and set the href attribute. In your code behind, you can pull the stylesheet url from a config file, database, etc. Also node, the property needs a public or protected access modifier in order for the code-behind to access it.

HTH
 
Thanks for your suggestion.
I also think about this way but the problem is the project on which i am working cotains more then 100 pages and it is not possible for me to use this type of solution, However thanks for your suggestion.

Thanks,
 
I also think about this way but the problem is the project on which i am working cotains more then 100 pages and it is not possible for me to use this type of solution, However thanks for your suggestion.
Sure it could work for you, the project I'm currently working on has around 1000 pages and we use this type of solution. All your pages are using css stylesheets right (not inline)?
 
Back
Top