473,434 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,434 software developers and data experts.

storing my own information in the Request object

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
Sep 18 '07 #1
7 1325
viewstate("yourValiableNameWhichPersistsDuringPost back")
session("VariableAvailableOnlyToYouForYourSession" )
application("availableToAnyoneUsingTheApp")


"Andy Fish" <aj****@blueyonder.co.ukwrote in message
news:eY****************@TK2MSFTNGP02.phx.gbl...
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


Sep 18 '07 #2
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

"Just Me" <news.microsoft.comwrote in message
news:uU****************@TK2MSFTNGP06.phx.gbl...
viewstate("yourValiableNameWhichPersistsDuringPost back")
session("VariableAvailableOnlyToYouForYourSession" )
application("availableToAnyoneUsingTheApp")


"Andy Fish" <aj****@blueyonder.co.ukwrote in message
news:eY****************@TK2MSFTNGP02.phx.gbl...
>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



Sep 18 '07 #3
"Andy Fish" <aj****@blueyonder.co.ukwrote in message
news:Om*****************@TK2MSFTNGP06.phx.gbl...
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...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 18 '07 #4
you want the HttpContext.Items collection. it designed for this.

-- bruce (sqlwork.com)

Andy Fish wrote:
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

Sep 18 '07 #5
Thanks bruce, sounds perfect

surprised I didn't spot this one when RTFMing :-)
"bruce barker" <no****@nospam.comwrote in message
news:%2*****************@TK2MSFTNGP02.phx.gbl...
you want the HttpContext.Items collection. it designed for this.

-- bruce (sqlwork.com)

Andy Fish wrote:
>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
Sep 19 '07 #6
session state is not available in the BeginRequest handler

"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:un***************@TK2MSFTNGP06.phx.gbl...
"Andy Fish" <aj****@blueyonder.co.ukwrote in message
news:Om*****************@TK2MSFTNGP06.phx.gbl...
>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...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 19 '07 #7
"Andy Fish" <aj****@blueyonder.co.ukwrote in message
news:u0****************@TK2MSFTNGP02.phx.gbl...
session state is not available in the BeginRequest handler
You're quite correct - sorry for the confusion...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 19 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Brian Burgess | last post by:
Hi all, Anyone know of any special issues with storing cookies with ASP? I'm trying this with two browsers: One is IE 6.0 with cookies set to 'prompt'. This has been working properly as any...
3
by: marco_segurini | last post by:
Hi, the 'user' class describes what is my target: I want to save a reference to a class instance and a reference to the reference to the class instance calling a 'user' member function and...
2
by: Robert Hanson | last post by:
I am new to the asp.net application building and I have read the information regarding the storing of information using session vs cookies vs viewstate. I am asking for suggestions/guidance as to...
4
by: Dharmesh | last post by:
Hi every1, I am learning ASP.NET and came accross problem of storing my classes object and I want its scope to be request. Is there a way do that. I found the only way to store structured values...
2
by: jakk | last post by:
Iam storing the session state in SQL Server. The Session gets stored in the SQL Server temp tables ( I can see some values in the two tables), but the session doesnt seem to timeout. We have a...
12
by: Alex D. | last post by:
is it possible? pros and cons?
6
by: (PeteCresswell) | last post by:
User wants to go this route instead of storing pointers in the DB and the documents outside. Only time I tried it was with only MS Word docs - and that was a loooong time ago - and it seemed to...
9
by: david | last post by:
I have a class with some business-logic and with every roundtrip, I need an instance of this class, so I have to create it, every time again. That doesn't seem very efficient. I thought it would...
3
by: RSH | last post by:
Hi, I have a situation where I have created an object that contains fields,properties and functions. After creating the object I attempted to assign it to a session variable so i could retrieve...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.