欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

asp.net 組件開發(fā)中的內(nèi)嵌資源引用

 更新時間:2011年12月22日 21:22:47   作者:  
asp.net 組件開發(fā)中的內(nèi)嵌資源引用實現(xiàn)代碼,需要的朋友可以參考下。
類名字空間前資源注冊
復(fù)制代碼 代碼如下:

[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<script type=\"text/javascript\" src=\"{0}\" ></script>", _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<script type=\"text/javascript\" src=\"{0}\" ></script>", _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);
}

相關(guān)文章

最新評論