首页
VS Code教程
(current)
VS Code插件
(current)
VS Code打造IDE
(current)
VScode更新日志
(current)
关于
asp.net 组件开发中的内嵌资源引用
368
人浏览 /
0
人评论
类名字空间前资源注册
复制代码
代码如下:
[assembly: System.Web.UI.WebResource("XXX.js.FilePlugin.js", "text/javascript")]
OnPreRender事件
//资源名称
string _strResourceKey = ""; //资源名称
ClientScriptManager _csm = Page.ClientScript;
//if (this.Page.Header.FindControl(_strResourceKey) == null)
//{
// string _src = _csm.GetWebResourceUrl(this.GetType(), _strResourceKey);
// Literal _literal = new Literal();
// _literal.ID = _strResourceKey;
// _literal.Text = string.Format("\n", _src);
// this.Parent.Page.Header.Controls.Add(_literal);
//}
//if (!this.Page.ClientScript.IsStartupScriptRegistered(_strResourceKey))
//{
// string _src = _csm.GetWebResourceUrl(this.GetType(), _strResourceKey);
// _src = string.Format("\n", _src);
// Page.ClientScript.RegisterStartupScript(this.GetType(), _strResourceKey, _src);
//}
if (!this.Page.ClientScript.IsClientScriptIncludeRegistered(_strResourceKey))
{
string _src = _csm.GetWebResourceUrl(this.GetType(), _strResourceKey);
Page.ClientScript.RegisterClientScriptInclude(this.GetType(), _strResourceKey, _src);
}
您可能感兴趣的文章:
ASP.NET主机资源控制的一些心得
asp.net(C#) 开源资源大汇总
asp.net中资源文件的使用
实例讲解.NET中资源文件的创建与使用
.NET 资源文件resx、Resources详细说明
ASP.NET 服务器路径和一般资源调用
详谈.net中的垃圾回收机制
asp.net中virtual和abstract的区别分析
ASP.NET实现将word文档转换成pdf的方法
ASP.NET配置文件Web.config用法详解
ASP.net全局程序文件Global.asax用法分析
.net非托管资源的回收方法
相关文章
如何有效避免设计作品“空”?
高点击率钻展,设计环节…
无敌配色技巧(一)
留言
全部评论
晴天下起了小雨
2017-10-01 18:00
很喜欢,果断关注了
回复
wjmyly7336064
2017-10-01 18:00
相当实用,赞美了
橘大佬
2017-10-01 18:00
就是有些细节再到位点就好了…
回复
微信公众号
关注微信公众号获取更多VSCode编程信息,定时发布干货文章
最新文章
What's the make money?
MySQL 9.0 的新增功能
Apple 在 iOS 17 中使用 Swift 和 SwiftUI
编写更多“无用”软件
windows 修改环境变量后在 vscode 的终端不生效的两种解决方法
整理列出PHP各个版本5.2至8.0、8.1的特性以及区别
unicode 表情对照表
Stable Diffusion(AI绘画)Lora模型BRA V4发布:AI生成东亚人照片的生态可能因此改变
热门标签
VSCode
python
php
插件
防火墙
nodejs
远程开发
linux
virtualenv
flutter
安卓
苹果
图标主题
mysql
VScode插件
全部评论