通过global.asax向所有文件注册js

    protected void Application_PreRequestHandlerExecute(object sender, EventArgs e)
    {
        SchoolMIS.Sys.User.UserFactiory.GetUser().Delay(480);
        IHttpHandler handler = HttpContext.Current.CurrentHandler;
        if (handler != null && handler is Page)
        {
            string s = @"<script language=""javascript"" type=""text/javascript"" src=""/images/loading.js""><";
            s = s + "/script>";
            Page p = (Page)handler;
            p.RegisterClientScriptBlock("d", s);
        }
    }


    protected void Application_BeginRequest(object sender, EventArgs e)
    {
        //SchoolMIS.Sys.CacheProvider.Instance.Clear();
    }

posted @ 2010-03-10 16:39  zyip  阅读(296)  评论(0编辑  收藏  举报