方法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); } |
|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏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.