使用了 httpmodule 水晶報表 ,水晶報表的圖表圖片無法顯示

來源:互聯網
上載者:User

之前寫了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

導致該頁面無法顯示!

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.