在类里输出提示

 StringBuilder sb = new StringBuilder();
            sb.Append("<script language=""javascript""> "n");
            sb.Append("alert(""" + str.Trim() + """); "n");
            sb.Append("</script>");
            System.Web.HttpContext.Current.Response.Write(sb.ToString());

Page currentPage = HttpContext.Current.Handler as Page;

            if (currentPage != null)
            {
                currentPage.RegisterStartupScript("hit", sb.ToString());
            }
posted @ 2008-07-30 14:56  xjy  阅读(223)  评论(0编辑  收藏  举报