Is there any way to create/instantiate an object in an HTTP Module and then pass that object to the aspx page and then destory it back in the HTTPModule after the request is over? Something like:
In the HTTPModule:
Dim objGlobalGuy as SomeObject
Private Sub Application_BeginRequest(ByVal [source] as Object, ByVal e as EventArgs)
...
GlobalGuy = New SomeObject( parameters... )
...
End Sub
Private Sub Application_EndRequest(ByVal [source] as Object, ByVal e as EventArgs)
...
'If GlobalGuy is a COM object then do:
Marshal.ReleaseComObject(GlobalGuy)
GlobalGuy = nothing
...
End Sub
===============================
Then, somewhere in an aspx page:
If GlobalGuy( someParameter ) Then
'Do some stuff
End If
OK. I've got the Httpcontext (System.Web.HttpContext.Current).... NOW, I need to pass this context (or something similar) off to a COM object (Not .Net) that is expecting a ASPTypeLibrary.ScriptingContext object. Any ideas? Thanks,
ojm37
Contributor
2248 Points
832 Posts
Passing object to aspx from HTTPModule?
Jun 11, 2004 10:11 PM|LINK
In the HTTPModule: Dim objGlobalGuy as SomeObject Private Sub Application_BeginRequest(ByVal [source] as Object, ByVal e as EventArgs) ... GlobalGuy = New SomeObject( parameters... ) ... End Sub Private Sub Application_EndRequest(ByVal [source] as Object, ByVal e as EventArgs) ... 'If GlobalGuy is a COM object then do: Marshal.ReleaseComObject(GlobalGuy) GlobalGuy = nothing ... End Sub =============================== Then, somewhere in an aspx page: If GlobalGuy( someParameter ) Then 'Do some stuff End IfHow to do this, or something like it? TIA,intesoft
Member
561 Points
114 Posts
Re: Passing object to aspx from HTTPModule?
Jun 14, 2004 01:18 PM|LINK
ASPAccelerator.NET - Fewer bytes, faster pages
ASPRedirector.NET - Put friendly URLs on your site
ojm37
Contributor
2248 Points
832 Posts
Re: Passing object to aspx from HTTPModule?
Jun 15, 2004 09:00 PM|LINK
ojm37
Contributor
2248 Points
832 Posts
Re: Passing object to aspx from HTTPModule?
Jun 15, 2004 11:28 PM|LINK