分类广告


推荐文章

  • 没有找到任何内容!
您当前的位置:中国站长下载网络编程NET专区 → 文章内容

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

  • 作者:不详    来源:网络转载    发布时间:2008-2-28 8:32:29
  • 字体大小:

在asp.net中,有的时候要动态变换CSS,比如有的时候做个性化页面,可以这样做。 中国.站长站

以下为引用的内容:
   <head>
  <link id="MyStyleSheet" rel="stylesheet" type="text/css" runat="server" />
  </head>

中国站.长站

之后,在要更换CSS的页面中,使用如下代码

Www~Chinaz~com

以下为引用的内容:
   Sub Page_Load(Sender As Object, E As EventArgs)
  If Not (IsPostBack)
  MyStyleSheet.Attributes.Add("href","/css/flostyle.css")
  End If 
[中国站长站]

 
Chinaz