[开源]后台调用js,今天刚学的,哈
#region 后台调用js
public void RegisterClientScriptBlock(System.Web.UI.Page page,string script)
{
string strKey;
int i;
//注册脚本块的Key
strKey=System.DateTime.Now.ToString();
//循环,直至找到某个没被注册过的Key
for (i=0;i<100;i++)
if (!page.IsClientScriptBlockRegistered(strKey+i.ToString()))
break;
page.RegisterClientScriptBlock(strKey+i.ToString(),script);
}
#endregion
this.RegisterClientScriptBlock(this,"<script>document.getElementById(\"minute\").innerHTML=\"hello\";</script>");