AsifCh Posted August 2, 2004 Posted August 2, 2004 (edited) 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 Edited August 3, 2004 by AsifCh Quote Asif Raza Ashraf Senior Software Engineer Electronic Solutions Pakistan Islamabad
TwistedNerve Posted August 4, 2004 Posted August 4, 2004 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. Quote
*Gurus* Derek Stone Posted August 4, 2004 *Gurus* Posted August 4, 2004 Start reading: http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemWebUI.asp Quote Posting Guidelines
AsifCh Posted August 5, 2004 Author Posted August 5, 2004 Assuming you are not able to wait for the next release of ASP.NET (where *skining* is natively supported)' date=' 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.[/quote'] Hi, Thanks for your reply. Can you guide me how to load stylesheets dynamically at runtime. Thanks, Quote Asif Raza Ashraf Senior Software Engineer Electronic Solutions Pakistan Islamabad
TwistedNerve Posted August 5, 2004 Posted August 5, 2004 You could wrap the link tag in a usercontrol and set the href attribute in your code behind: <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 Quote
AsifCh Posted August 6, 2004 Author Posted August 6, 2004 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, Quote Asif Raza Ashraf Senior Software Engineer Electronic Solutions Pakistan Islamabad
TwistedNerve Posted August 6, 2004 Posted August 6, 2004 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)? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.