Sub Application_PreRequestHandlerExecute(ByVal sender As Object, ByVal e As EventArgs) Dim loPage As System.Web.UI.Page = Context.Handler LXFramework.oPage = loPage End SubThis works well. It allows me to initialize the oPage property of the framework. But, I need to add a verification in here. Because, I need to simply return if Context.Handler is of type System.Web.HttpForbiddenHandler. Because if someone tries to pull out a file with a .vb extension, such as account.aspx.vb, this will return the following error on the Dim line:
Unable to cast object of type 'System.Web.HttpForbiddenHandler' to type 'System.Web.UI.Page'.So, what can I do to have some kind of condition in here to verify for this?