zoukankan      html  css  js  c++  java
  • Catch ReportViewer Exception

    Problem:

     I would like to know how I can catch errors that showup on my reportviewer web server control when for instance there is a parameter whose value was not set.

    Solution:

    You can you the ReportError method of the ReportViewer control. It has an 'e' argument of type ReportErrorEventArgs, which you can use to handle the error.

    For example, I have a page where I use it like this:

    Protected Sub ReportViewer1_ReportError(ByVal sender As Object, ByVal e As Microsoft.Reporting.WebForms.ReportErrorEventArgs) Handles ReportViewer1.ReportError 
    If TypeOf e.Exception Is AspNetSessionExpiredException Then
    e.Handled = True
    Session.Abandon()
    FormsAuthentication.SignOut()
    Response.Redirect(FormsAuthentication.LoginUrl, True)
    Else
    e.Handled = False
    End If
    End Sub


    from:

    http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_23871497.html

    http://www.codeprof.com/dev-archive/90/6-75-908431.shtm

  • 相关阅读:
    POJ 1144 Network(割点)
    POJ 3177 Redundant Paths & POJ 3352 Road Construction(双连通分量)
    ASCII码
    数组
    Java语法基础
    eclipse汉化过程
    指针
    面向对象
    第一课JAVA开发环境配置
    初学编写JAVA程序
  • 原文地址:https://www.cnblogs.com/emanlee/p/1326593.html
Copyright © 2011-2022 走看看