.net 页面动态注册CSS 、JS

//注册JS
if (!Page.ClientScript.IsClientScriptIncludeRegistered(GetType(), "abc"))
{
Page.ClientScript.RegisterClientScriptInclude(GetType(), "abc", ResolveClientUrl("js文件路径"));


}
//注册CSS

ClientScript.RegisterClientScriptBlock(GetType(), "regCss", "<link rel=\"stylesheet\" type=\"text/css\" href=\"" css文件路径") + "\" />");

  

posted @ 2013-05-16 11:44  放哨De老鼠  阅读(273)  评论(0编辑  收藏  举报