Colin,
If you always want it to be included then require it as a parameter of your
class' sub new:
Private _HttpApplication
Public Sub New(ByRef httpApplication As System.Web.HttpApplication)
_HttpApplication = httpApplication
End Sub
If you just need it for one method inside of your class declare it as a
parameter of that method itself
Public Sub MyMethod(ByRef httpApplication As System.Web.HttpApplication)
End Sub
You should use ByRef instead of ByVal so that if you store something in the
HttpApplication.Context object or make other changes to it's properties they
will be reflected throughout the application.
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"Colin" <c@..cl> wrote in message
news:OE*************@TK2MSFTNGP10.phx.gbl...
Ah, I see. Classes are new'ish to me. How did I pass HttpApplication to
the class when instantiated? I'm using Vb.Net.
Colin.
"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> wrote in
message news:eh**************@tk2msftngp13.phx.gbl...
Colin,
It's not enough to just inherit it. The page fills many properties of the
class. If you pass the current instance of the HttpApplication object into
your class then you'll be able to access it the way you want.
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"Colin" <c@..cl> wrote in message
news:u2**************@TK2MSFTNGP10.phx.gbl... In the code behind server.mappath works fine, yet in a class I get
'Server
operation is not available in this context'. System.Web.HttpApplication
is
inherited in the class, why is this so?
Colin.