User control If you want to centrally define a similar
<style type= "Text/css" >
. C {border-right:1px #D9AE7F solid;border-bottom:1px #D9AE7F solid;cursor:pointer;font-family:arial;font-weight:bold Height:23px;background: #FFF7DD None repeat scroll 0 0; line-height:20px;}
#ctem TD {Border-bottom:1px solid #F0F0F0; color:black;height:25px;}
#ctem A:link, #cctvitem a:active, #cctvitem a:visited {color:black;text-decoration:none;}
#ctem a:hover {Color:red;text-decoration:underline}
. Tmspan {cursor:pointer;display:inline;width:70px;margin:3px 2px 0px 2px;height:16px;border-left:1px solid #D9AE7F; border-right:1px solid #D9AE7F; border-top:1px solid #D9AE7F; text-align:center;font-weight:bold;}
</style>
What to do with this CSS.
If it is written in the control, does not conform to the specification, although generally also works, but if it is dynamic loading, such as Ajax load the user control, it is not.
If the call page is written in front of the page, of course, it is fine, but the meaning of the control is discounted.
You can use the following methods:
Control code:
Const string STYLE = @ "<style type=" "Text/css" ">
. C {border-right:1px #D9AE7F solid;border-bottom:1px #D9AE7F solid;cursor:pointer;font-family:arial;font-weight:bold Height:23px;background: #FFF7DD None repeat scroll 0 0; line-height:20px;}
#ctem TD {Border-bottom:1px solid #F0F0F0; color:black;height:25px;}
#ctem A:link, #cctvitem a:active, #cctvitem a:visited {color:black;text-decoration:none;}
#ctem a:hover {Color:red;text-decoration:underline}
. Tmspan {cursor:pointer;display:inline;width:70px;margin:3px 2px 0px 2px;height:16px;border-left:1px solid #D9AE7F; border-right:1px solid #D9AE7F; border-top:1px solid #D9AE7F; text-align:center;font-weight:bold;}
</style> ";
protected void Page_Load (object sender, EventArgs e)
{
Controls own CSS
This. PAGE.HEADER.CONTROLS.ADD (New LiteralControl (STYLE));
}
The CSS for this control will appear in the