Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting the type of Context.Handler
Message
From
06/07/2006 13:45:44
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Detecting the type of Context.Handler
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01134220
Message ID:
01134220
Views:
82
In my global.asax, I have something like this:
    Sub Application_PreRequestHandlerExecute(ByVal sender As Object, ByVal e As EventArgs)
        Dim loPage As System.Web.UI.Page = Context.Handler
        LXFramework.oPage = loPage
    End Sub
This 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?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Reply
Map
View

Click here to load this message in the networking platform