找回密码
 注册
搜索
热搜: 回贴

服务器控件中js脚本注册方法

2009-12-16 01:16| 发布者: admin| 查看: 55| 评论: 0|原作者: 仙剑

方法1
#region 静态javascript脚本
const string sScript=@"
protected override void Render(HtmlTextWriter output)
{
output.Write(sScript);
}
方法2
using(StreamReader reader = new StreamReader(this.GetType().Assembly.GetManifestResourceStream(GetType(), "jsName.js")))
{
string sJsSlider = reader.ReadToEnd();

output.Write(sJsSlider);
}
方法3
using(StreamReader reader = new StreamReader(this.GetType().Assembly.GetManifestResourceStream(GetType(), "jsName.js")))
{
string sJsStart = reader.ReadToEnd();
Page.RegisterStartupScript(this.GetType().ToString() + this.UniqueID + "_Startup", sJsStart);
}

最新评论

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-29 19:27 , Processed in 0.375053 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

返回顶部