c# - Preventing the duplication of CSS files? -


I have got a user control that applies the context of a CSS file, now I use this user control multiple times on the page I would like to use, and this will duplicate the inclusion of a CSS file.

This ScriptManager with javascript files.

Is Simple by using, then ScriptManager ?

There is no easy way to check that the styles have been registered on a page such as client script utility .

If you register your style on the page as an external CSS file:

  HtmlLink link = new HtmlLink (); Link.Href = Relative Path; Link.Attributes ["type"] = "text / css"; Link.Attributes ["rel"] = "stylesheet"; Page.Header.Controls.Add (link);  

If you are searching for the page header's control collection and the path of the CSS file, you can check it.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -