StringBuilder scriptstring = new StringBuilder();
scriptstring.Append("<script language=javascript>");
scriptstring.Append("alert('OK');");
scriptstring.Append("</script>");
string js = scriptstring.ToString();
// Page.RegisterStartupScript("Setfirstfocus", js); vs 2003
Page.ClientScript.RegisterStartupScript(this.GetType(), "js", js);
服务器端向页面动态添加javascript脚本
最新推荐文章于 2024-10-30 18:24:25 发布