zoukankan
html css js c++ java
动态加载CSS文件
方法一:
<
HEAD
>
<
title
>
WebForm1
</
title
>
<
LINK
rel
="stylesheet"
type
="text/css"
href
=""
id
="mycss"
>
</
HEAD
>
private
void
Button1_Click(
object
sender, System.EventArgs e)
{Page.RegisterStartupScript(
"
css
"
,
@"
<script>mycss.styleSheet.addImport('stylesheet1.css')</script>
"
);
}
方法二:--- 戏子的方法..嘻..抄来的...
<
HEAD
>
<
title
>
WebForm1
</
title
>
<
asp:placeholder
id
="myplaceholder"
runat
="server"
></
asp:placeholder
>
</
HEAD
>
private
void
Button2_Click(
object
sender, System.EventArgs e)
{
System.Web.UI.Control a
=
Page.FindControl(
"
myplaceholder
"
);
System.Web.UI.HtmlControls.HtmlGenericControl objLink
=
new
HtmlGenericControl(
"
LINK
"
);
objLink.Attributes.Add(
"
rel
"
,
"
stylesheet
"
);
objLink.Attributes.Add(
"
type
"
,
"
text/css
"
);
objLink.Attributes.Add(
"
href
"
,
"
StyleSheet1.css
"
);
objLink
=
objLink;
a.Controls.Add(objLink);
}
[注]
asp:placeholder
这是控件是主要是起"占位符的做用"
查看全文
相关阅读:
Qt之自定义托盘(二)
使用react-navigation提示undefind is not a function
vue使用mockjs配置步骤(无需启动node服务)
input框type=file设置cursor:pointer的问题
umi中使用scss
umi怎么去添加配置式路由
Rem自适应js
解决在antd中使用 autoprefixer 9.4.5 会抛出错误 Replace text-decoration-skip: ink to text-decoration-skip-ink: auto, because spec had been changed 的问题
file类型input框设置上传相同文件,并都可以触发change事件。
浅谈JavaScript对象数组根据某属性sort升降序排序
原文地址:https://www.cnblogs.com/mmmhhhlll/p/72136.html
最新文章
/usr/bin/ld: warning: libavformat.so.57, needed by /home/camera.so, not found (try using -rpath or -rpath-link)
QCustomplot使用分享(六) 坐标轴和网格线
QCustomplot使用分享(五) 布局
QCustomplot使用分享(四) QCPAbstractItem
QCustomplot使用分享(三) 图
QCustomplot使用分享(二) 源码解读
QCustomplot使用分享(一) 能做什么事
Qt之QAbstractItemView右键菜单
Qt之QAbstractItemView视图项拖拽(二)
Qt之QAbstractItemView视图项拖拽(一)
热门文章
Qt之自定义QLineEdit右键菜单
Qt之二进制兼容
C++ 动态生成对象
Qt之自绘制饼图
Qt之自定义检索框
msvc2013编译qt5.6源码
自定义日历(二)
自定义日历(一)
窗口靠边自动隐藏
C++11 实现生产者消费者模式
Copyright © 2011-2022 走看看