这样用Css,虽然不合标准,但也是亡羊补牢的一招。

本文介绍了一种在 ASP.NET 中动态加载 CSS 的方法,通过使用 Literal 控件或者特殊的 ASPX 页面来实现 CSS 文件内容的动态读取与展示。

<style type="text/css">
  
     body{background:url('javascript:document.onselectstart=function(){return false;};document.onmouseup=function(){document.selection.empty();};document.onbeforecopy=function(){return false;};document.oncontextmenu=function(){return false;};document.ondragstart=function(){return false;};document.onselect=function(){document.selection.empty();};document.oncopy=function(){document.selection.empty();};document.onbeforecopy=function(){return false;};document.onmouseup=function(){document.selection.empty();}')}

</style> 

 

前几天,看一贴后,学习。

 

可以在   <HEAD>   加一个   Literal   控件,然后在此控件中动态的写引入   CSS   的内容  
  也可以:  
  <link   rel="stylesheet"   type="text/css"   href="importcss.aspx">  
  注意上面的   href   是importcss.aspx,  
  在   importcss.aspx   页面中可以动态的读取   css   文件中的内容然后显示出来

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值