使用了 httpmodule 水晶报表 ,水晶报表的图表图片无法显示

之前写了httpmodule ,后来发现项目中的水晶报表图表不显示了。

 

 public void Init(HttpApplication context)
        {
            context.AcquireRequestState += new EventHandler(context_AcquireRequestState);

        }

        #endregion

        void context_AcquireRequestState(object sender, EventArgs e)
        {

            // 获取应用程序

            HttpApplication application = (HttpApplication)sender;

            string url = application.Context.Request.Path;

            string type = url.Substring(url.LastIndexOf('.'));
            if (type.ToLower() == ".aspx" && url!="/CrystalImageHandler.aspx")
            {

//执行操作~~ 

 

 

说名,右击无法显示的图标,发现是个png图片,地址放到url,发现错误:

 

 

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 39:                 // 检查用户是否已经登录
Line 40: 
Line 41:                 if (application.Context.Session["loginusername"] == null)
Line 42:                 {
Line 43: 

 

发现是之前的模块写的方法session判断

 

经调试,发现当水晶报表会把图标以/CrystalImageHandler.aspx"   显示到浏览器,然而这个页面不知道为什么不能检测出session

导致该页面无法显示!

 

 

posted @ 2009-10-23 16:55  ChouKei  阅读(382)  评论(0编辑  收藏  举报