storing my own information in the Request object

A

Andy Fish

Hi,

Is there anywhere inside the HttpRequest object that I can use to store my
own information? from what I can see things like ServerVariables are made
read-only.

If not, does anyone else have a sensible strategy for storing information
that pertains to a particular request so that it can be shared between
global.asax handlers and the page itself? I cannot use session state for
this.

TIA

Andy
 
J

Just Me

viewstate("yourValiableNameWhichPersistsDuringPostback")
session("VariableAvailableOnlyToYouForYourSession")
application("availableToAnyoneUsingTheApp")
 
A

Andy Fish

thanks but none of those help me

i want something that is specific to this request - specifically

(a) I can set in the global.asax Application_BeginRequest handler and
retrieve in the page itself

(b) is not shared between concurrent requests on the same session
 
M

Mark Rae [MVP]

i want something that is specific to this request - specifically

(a) I can set in the global.asax Application_BeginRequest handler and
retrieve in the page itself

That's what the Session object is for...
(b) is not shared between concurrent requests on the same session

When you put something in the Session object, it isn't *shared* between
concurrent requests per se - it is *available* to all requests, which is not
the same thing...
 
B

bruce barker

you want the HttpContext.Items collection. it designed for this.

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,985
Messages
2,570,199
Members
46,766
Latest member
rignpype

Latest Threads

Top