[csharp]

/*注册javacript脚本的几种方法*/
string name = "myJavaScriptCode.js";
Page.ClientScript.RegisterClientScriptInclude("myKey", name);*/

//引入js文件
HtmlGenericControl scriptControl = new HtmlGenericControl("script");
scriptControl.Attributes.Add("type", "text/javascript");
scriptControl.Attributes.Add("language", "JavaScript");
scriptControl.Attributes.Add("src", "../js/menu.js");
Page.Header.Controls.Add(scriptControl);

[/csharp]

发表评论

/ 快捷键:Ctrl+Enter
加载中……