Posted on 16/03/2015 16:52:21
Or add a simple notification subscriber:
Imports System
Imports System.Web
Imports Dynamicweb
Imports Dynamicweb.Extensibility
Imports Dynamicweb.Notifications
<Extensibility.Subscribe(Global.Dynamicweb.Notifications.Standard.Application.BeginRequest)> _
Public Class ApplicationBeginRequestObserver
Inherits Global.Dynamicweb.Extensibility.NotificationSubscriber
Public Overrides Sub OnNotify(ByVal notification As String, ByVal args As Global.Dynamicweb.Extensibility.NotificationArgs)
Try
If args Is Nothing Then
Return
End If
If Not (TypeOf args Is Global.Dynamicweb.Notifications.Standard.Application.BeginRequestArgs) Then
Return
End If
Dim item As Global.Dynamicweb.Notifications.Standard.Application.BeginRequestArgs = DirectCast(args, Global.Dynamicweb.Notifications.Standard.Application.BeginRequestArgs)
Dim app As System.Web.HttpApplication = DirectCast(item.sender, System.Web.HttpApplication)
If Not app.Context Is Nothing AndAlso Not app.Context.Request Is Nothing Then
'make data check...
HttpContext.Current.Response.End()
End If
Catch ex As Exception
End Try
End Sub
End Class