ASP.NET 2.0 provides a powerful theming system that is optimized for
dynamically changing the look and feel of any site. Doing it via CSS
files is just a very simplistic way. However, if you must, you could
do it by adding two things to your <link> tag:

1. An ID so it can be referenced in code.
2. A runat="server" attribute for the same purpose as above.

Then you can set your <link> element to point to the appropriate CSS
file in code:

---
<head>
<link id="MyCSS" rel="stylesheet" type="text/css" runat="server"
href="summer.css" />
</head

...
'If Winter is selected,
MyCSS.Attributes("href") = "winter.css"
---

On Oct 13, 2:42 pm, Suraj <[email protected]> wrote:
> Hi all,
>
> I am trying to introduce themes in my project. I have two css files for
> theme 1. summer 2. winter. Based on the selection in drop down, the theme is
> getting set as summer or winter.
>
> 1 . So, is it possible to introduce themes only with css files?
> ---------------------------------------------------------------------------­---------------------------------------------------------------------------­------------------------------
> I have master pages. The theme selection wil change the theme in the Master
> page which in turn will get reflected in all the pages. I have written code
> in Page_PreInit of Master page.
>
> 2. Is the above usage fine?
> ---------------------------------------------------------------------------­---------------------------------------------------------------------------­------------------------------
> Thanks,
>
> Regards,
> Suraj

Reply via email to