Changing Skin of Web Page [modified]
-
Hi Developers I want my customers to chooose from different templates for there Ad page like: http://www.onestopmotors.com/ad_details.aspx?ad_id=7365[^]. Please let me know what is the best way to implement this concept(having multiple skins)? I know there are skin files in ASP.net 2.0 but I have to use ASP.net 1.1. Thanks for your time
All the way from Sialkot ...
modified on Monday, January 28, 2008 12:28:18 PM
-
Hi Developers I want my customers to chooose from different templates for there Ad page like: http://www.onestopmotors.com/ad_details.aspx?ad_id=7365[^]. Please let me know what is the best way to implement this concept(having multiple skins)? I know there are skin files in ASP.net 2.0 but I have to use ASP.net 1.1. Thanks for your time
All the way from Sialkot ...
modified on Monday, January 28, 2008 12:28:18 PM
As you are using .Net 1.1, and don't have the option of theming, the easiest way would be to have multiple stylesheets, and use the QueryString variable to determine which stylesheet to link to. In the
<head>
section of your aspx page, add a standard link element that links to your default CSS file. Give it an ID and mark it torunat="server"
. In your code-behind file, make sure the link element is declared as typeSystem.Web.UI.HtmlControls.HtmlLink
along with the other page controls. Then, when the page loads you can simply check the QueryString to see which stylesheet to use. If you have a valid stylesheet then simply set your declared link elements href property. Hope this helps...Clean code is the key to happiness.