How to add CSS link file to ASP.NET page header dynamically using C#?
I need to change between language by changing CSS style file dynamically. Please help me to do this. Thank you in advance.
How to add CSS link file to ASP.NET page header dynamically using C#?
I need to change between language by changing CSS style file dynamically. Please help me to do this. Thank you in advance.
Use HtmlLink
class to add css dynamically, this is how:
protected void Page_Init(...)
{
HtmlLink myHtmlLink = new HtmlLink();
myHtmlLink.Href = "~/css1.css";
myHtmlLink.Attributes.Add("rel", "stylesheet");
myHtmlLink.Attributes.Add("type", "text/css");
Page.Header.Controls.Add(myHtmlLink);
}
i need to change between language
Consider using resx-files if the elements depend on the selected languages.