I've a CSS file, say SomeStyle.css. Is it possible for me to apply this style sheet document to an aspx page from its code behind?
External CSS is a file that contains only CSS code and is saved with a ". css" file extension. This CSS file is then referenced in your HTML using the <link> instead of <style>.
Note: There are two different ways to import a CSS file into another using @import url(“style2. css”); or @import “style2. css”; or directly import any CSS file or multiple CSS file in the HTML file directly within <style>@import “style1.
In External css we use . css extension. . css extension is used for saving a css file.
You can add literal controls to your header control:
Page.Header.Controls.Add(
new System.Web.UI.LiteralControl("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + ResolveUrl("~/Styles/SomeStyle.css") + "\" />"));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With