Click here to Skip to main content
15,881,089 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi everybody. I want to create a asp.net server control, i want emable css file.
C#
Type rsType = this.GetType();
           string csslink = @"<link rel='stylesheet' type='text/css' href='" +
               Page.ClientScript.GetWebResourceUrl(rsType, "Lib.Style.base.css") + "' />";

           LiteralControl include = new LiteralControl(csslink);

           this.Page.Header.Controls.Add(include);

But when i built and use it, i dose not work.

Thanks to support
Posted

 
Share this answer
 
Thanks you for reply. But i am trying it, it still do not works.

C#
private void RegisterCSSInclude(Control target)
        {
             Type rsType = this.GetType();
            string csslink = @"<link rel="stylesheet" type="text/css" href="" + <br mode="hold" />                Page.ClientScript.GetWebResourceUrl(rsType, "Lib.Style.base.css") + "" />";
           
            LiteralControl include = new LiteralControl(csslink);

            this.Page.Header.Controls.Add(include);

        }
 
Share this answer
 
Comments
_Zorro_ 27-May-14 13:37pm    
Comment on Prasad answer, do not create a new one.
tieudoan208 28-May-14 5:49am    
Somebody help me

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900