If you are trying to change your website color scheme without using jQuery you can use this code.


protected void Page_Init(object sender, EventArgs e)
{
HtmlGenericControl css;
css = new HtmlGenericControl();
css.TagName = "style";
css.Attributes.Add("type", "text/css");
css.InnerHtml = "@import \"/Content/skin/green.css\";";
Page.Header.Controls.Add(css);
}

The above code works nicely but it didn’t work the way I wanted it to since I had more than on style sheet and needed the color to change on button click.
To make it work I created an app setting in the web config with its value the name of a color scheme stylesheet, I added different buttons for the different colors so when a button is clicked it will update the value of the app setting to the name of the stylesheet its representing and I also changed my Page Init method to check the value in the app setting in web config and load the stylesheet with the same name

If you’re using a master page you can place this code once in the code behind.

<add key="StyleColor" value="colourname" />


protected void Page_Init(object sender, EventArgs e)
{
Configuration config = WebConfigurationManager.OpenWebConfiguration("~");
KeyValueConfigurationElement stylecolor = config.AppSettings.Settings["StyleColor"];
if (null != stylecolor)
{
var color = stylecolor.Value.ToString();
HtmlGenericControl css;
css = new HtmlGenericControl();
css.TagName = "style";
css.Attributes.Add("type", "text/css");
css.InnerHtml = "@import \"/Content/skin/" + color+ ".css\";";
Page.Header.Controls.Add(css);
}
}