/// <summary>
        /// 在页面中输出javascript脚本
        /// </summary>
        /// <param name="script">要输出的javascript脚本</param>
        public static void ResponseScript(string script)
        {
            if (Anthem.Manager.IsCallBack)
            {
                Anthem.Manager.AddScriptForClientSideEval(script);
            }
            else
            {
                Page page = HttpContext.Current.Handler as Page;
                script = String.Format(@"
<script type=""text/javascript"">
window.attachEvent(""onload"", function()
{{
{0}
}});
</script>", script);
                page.ClientScript.RegisterClientScriptBlock(page.GetType(), script, script, false);
            }
        }

 

AnthemHelper.ResponseScript("CloseThis();");

posted on 2012-12-20 10:56  过往云烟  阅读(126)  评论(0编辑  收藏  举报