之前写了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,发现错误:
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:
|
发现是之前的模块写的方法session判断
经调试,发现当水晶报表会把图标以/CrystalImageHandler.aspx" 显示到浏览器,然而这个页面不知道为什么不能检测出session
导致该页面无法显示!