Northwind Traders Sample Application Documentation Home | Online Sample | Documentation

CustomError.aspx.vb Language: Font Size:
Web Pages: CustomError.aspx.vb   CustomError.aspx   

Namespace TechmaticaNorthwindUserInterface
    Public Class CustomError
        Inherits System.Web.UI.Page
        Protected InformationLabel As System.Web.UI.WebControls.Label
        Protected MessageLabel As System.Web.UI.WebControls.Label
        Protected ShowErrrorCheckBox As System.Web.UI.WebControls.CheckBox
        Private designerPlaceholderDeclaration As Object
        <System.Diagnostics.DebuggerStepThrough()>  _
        Private Sub InitializeComponent()
        End Sub
        Private Sub LoadClass(ByVal Sender As Object, ByVal E As System.EventArgs)
            Me.MessageLabel.Text = "An Internal Error has occured, web master has been notified, click on check box t"& _ 
"o view a detailed error message."
            Me.InformationLabel.Text = System.Web.HttpContext.Current.Server.HtmlDecode(System.Web.HttpContext.Current.Server.UrlDecode(System.Web.HttpContext.Current.Request.Params("err")))
            Me.InformationLabel.Visible = false
        End Sub
        Protected Overrides Sub OnInit(ByVal e As System.EventArgs)
            Me.InitializeComponent
            AddHandler MyBase.Load, AddressOf Me.LoadClass
            AddHandler ShowErrrorCheckBox.CheckedChanged, AddressOf Me.ShowErrrorCheckBoxChanged
            MyBase.OnInit(e)
        End Sub
        Private Sub ShowErrrorCheckBoxChanged(ByVal Sender As Object, ByVal E As System.EventArgs)
            If Me.ShowErrrorCheckBox.Checked Then
                Me.InformationLabel.Visible = true
            Else
                Me.InformationLabel.Visible = false
            End If
        End Sub
    End Class
End Namespace