raisun_1988 发表于 2013-2-7 22:31:00

教你在asp.net中动态变更CSS

【网上购物论坛】-IT泡吧!网上购物社区! - Powered by Discuz!
http://www.itpob.cn/
在asp.net中,有的时候要动态变换CSS,比如有的时候做个性化页面,可以这样做。
 
以下为引用的内容:
   <head>
  <link id="MyStyleSheet" rel="stylesheet" type="text/css" runat="server" />
  </head> 之后,在要更换CSS的页面中,使用如下代码
 
以下为引用的内容:
   Sub Page_Load(Sender As Object, E As EventArgs)
  If Not (IsPostBack)
  MyStyleSheet.Attributes.Add("href","/css/flostyle.css")
  End If 
页: [1]
查看完整版本: 教你在asp.net中动态变更CSS