I encountered this problem yesterday and it is difficult to solve it.
After checking the garden, some other brothers answered this question, but I still don't think it is clear. Here I will summarize it for you.
For example
1 < Link Href = "Addeditpayment.css" Type = "Text/CSS" REL = "Stylesheet" >
2 // For dynamic loading, you need to write this statement again on the page
3 < Link ID = "Cssaddeditpayment" Href = "Addeditpayment.css" Type = "Text/CSS" REL = "Stylesheet" Runat = "Server" />
4 // Please note here/>. If runat = "server" HTML is used, it must end.
Then we add a statement in. CS.
Protected Htmlgenericcontrol cssaddeditpayment;
Perform the following operations during page load:
String Cssfile = Dancepub. getcssname ( " Addeditpayment " ) + " . CSS " ;
Cssaddeditpayment. Attributes. Add ( " Href " , Cssfile );
here, getcssname is my function, so ignore it
here, all labels on the page can be declared and managed using htmlgenericcontol.
the practice in dnn is similar to this, but for integrity, it is a little troublesome to use.