|
 |
aspx thread: Accessing things like Session & Request within custom classes?
Message #1 by "Oliver, Wells" <WOliver@l...> on Tue, 5 Nov 2002 09:52:45 -0800
|
|
I am trying to build a custom class to handle some security aspects, and one
of the things I need to is access Request.ApplicationPath. However, I can't
seem to make this fit: the class I am building does not extend
HttpApplication or anything. I'm missing something here-- any tips?
Wells Oliver
Web Applications Programmer
Leviton Voice & Data
xxx-xxx-xxxx
http://www.levitonvoicedata.com
Message #2 by =?iso-8859-1?Q?S=E6mundur_Valdimarsson?= <saemund@h...> on Wed, 6 Nov 2002 08:48:15 -0000
|
|
You can use the HttpContext class:
System.Web.HttpContext context =3D System.Web.HttpContext.Current;
sAppPath =3D context.Request.ApplicationPath.ToString();
-SV
-----Original Message-----
From: Oliver, Wells [mailto:WOliver@l...]
Sent: 5. n=F3vember 2002 17:53
To: ASP.NET
Subject: [aspx] Accessing things like Session & Request within custom
classes?
I am trying to build a custom class to handle some security aspects, and
one of the things I need to is access Request.ApplicationPath. However,
I can't seem to make this fit: the class I am building does not extend
HttpApplication or anything. I'm missing something here-- any tips?
Wells Oliver
Web Applications Programmer
Leviton Voice & Data
xxx-xxx-xxxx
http://www.levitonvoicedata.com
---
ASP.NET 1.0 Namespace Reference with C#
http://www.wrox.com/acon11.asp?ISBN=3D1861007442
ASP.NET 1.0 Namespace Reference with VB.NET
http://www.wrox.com/acon11.asp?ISBN=3D1861007450
These books are a complete reference to the ASP.NET namespaces
for developers who are already familiar with using ASP.NET.
There is no trivial introductory material or useless .NET
hype and the presentation of the namespaces, in an easy-to use
alphabetical order ensures a user-friendly reference format.
We provide in-depth coverage of all the major ASP.NET classes,
giving you those real-world tips that the documentation doesn't
offer, and demonstrating complex techniques with simple
examples.
---
|
|
 |