复制代码 代码如下:
if (!Page.ClientScript.IsClientScriptIncludeRegistered("jsFileInclude"))
Page.ClientScript.RegisterClientScriptInclude("jsFileInclude", "JsFile.js");
复制代码 代码如下:
string jsCodeBlock = "var MyStr='here'; alert(MyStr);";
if (!Page.ClientScript.IsStartupScriptRegistered("myJsCode"))
Page.ClientScript.RegisterStartupScript(typeof(string), "myJsCode", jsCodeBlock, true);
复制代码 代码如下:
string jsFile = "<script src=/"JsFile.js/" Type=/"text/javascript/"></script>";
if (!Page.ClientScript.IsStartupScriptRegistered("myJsFileRef"))
Page.ClientScript.RegisterStartupScript(typeof(string), "myJsFileRef", jsFile, false);
新闻热点
疑难解答
图片精选