If anyone has a more direct method, please kindly advise. I don't know whether. Net can change CSS directly.
<% @ Page Language = " C # " Autoeventwireup = " True " Codefile = " Default. aspx. CS " Inherits = " _ Default " %>
<!Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< Html Xmlns = "Http://www.w3.org/1999/xhtml" >
< Head Runat = "Server" >
< Title > Red solemn </ Title >
< Link Href = "CSS/face_red.css" REL = "Stylesheet" Type = "Text/CSS" />
< ASP: placeholder Runat = "Server" ID = "PHCSS" > </ ASP: placeholder >
</ Head >
< Body >
< Form ID = "Form1" Runat = "Server" >
</ Form >
</ Body >
</ Html >
Using System;
Using System. Data;
Using System. configuration;
Using System. Web;
Using System. Web. Security;
Using System. Web. UI;
Using System. Web. UI. webcontrols;
Using System. Web. UI. webcontrols. webparts;
Using System. Web. UI. htmlcontrols;
Public Partial Class _ Default: system. Web. UI. Page
{
Protected Void Page_load ( Object Sender, eventargs E)
{
If ( ! Ispostback)
Bindcss ();
}
Private Void Bindcss ()
{
Htmlgenericcontrol objlink = New Htmlgenericcontrol ( " Link " );
Objlink. attributes [ " REL " ] = " Stylesheet " ;
Objlink. attributes [ " Type " ] = " Text/CSS " ;
Objlink. attributes [ " Href " ] = " CSS/common.css " ;
PHCSS. Controls. Add (objlink );
}
}