Chinaunix首页 | 论坛 | 博客
  • 博客访问: 874524
  • 博文数量: 282
  • 博客积分: 10843
  • 博客等级: 上将
  • 技术积分: 2435
  • 用 户 组: 普通用户
  • 注册时间: 2006-07-01 15:23
文章分类

全部博文(282)

文章存档

2013年(1)

2012年(18)

2011年(14)

2010年(30)

2009年(48)

2008年(55)

2007年(55)

2006年(61)

分类: Java

2008-10-31 08:05:05

    突然发现CU的口号很有煽动力:“留住你的每一天”!呵呵,真能留住可好了
 
    本来睡的正香,被一阵敲门声惊醒——查煤气表的,穿戴整齐让人进屋一看才想起来——煤气还根本没用过,连煤气灶都没有(冷汗)……
 
    既然醒了就干活吧,偶然在网上找到这个,记下来,备用:
 
动态将js代码写到head标签中
方案一:
  HtmlGenericControl Include2 = new HtmlGenericControl("script");
  Include2.Attributes.Add(
"type""text/javascript");
  Include2.InnerHtml 
= "alert('JavaScript in Page Header');";
  this.Page.Header.Controls.Add(Include2);
方案二:
  Literal li = new Literal();
  li.Text = "";
  this.Page.Header.Controls.Add(li);
方案三:
  ScriptManager.RegisterClientScriptBlock(this.Page.Header, this.Page.Header.GetType(), "alert('动态向header添加js脚本');", true);  
阅读(1584) | 评论(2) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2008-11-15 16:53:48

呵呵,最近比较懒,继续努力……

chinaunix网友2008-11-11 11:30:23

终于更新博客了!