Here’s a code snippet used to programmatically insert a stylesheet link to an external CSS file:

// Create the <link> element for the CSS file
var stylesheet = new HtmlLink { Href = "/path/to/stylesheet.css" };
stylesheet.Attributes.Add("rel","stylesheet");
stylesheet.Attributes.Add("type","text/css");
 
// Add it to the <head> element of the page
Page.Header.Controls.Add(stylesheet);

  

相关文章:

  • 2022-03-07
  • 2021-06-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
  • 2022-12-23
  • 2021-09-21
猜你喜欢
  • 2021-12-02
  • 2021-06-26
  • 2022-12-23
  • 2021-11-22
  • 2020-05-10
  • 2021-08-12
  • 2022-12-23
相关资源
相似解决方案