Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

storing my own information in the Request object

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andy Fish - 18 Sep 2007 14:33 GMT
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
Just Me - 18 Sep 2007 15:08 GMT
viewstate("yourValiableNameWhichPersistsDuringPostback")
session("VariableAvailableOnlyToYouForYourSession")
application("availableToAnyoneUsingTheApp")

> Hi,
>
[quoted text clipped - 10 lines]
>
> Andy
Andy Fish - 18 Sep 2007 15:35 GMT
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

> viewstate("yourValiableNameWhichPersistsDuringPostback")
> session("VariableAvailableOnlyToYouForYourSession")
[quoted text clipped - 14 lines]
>>
>> Andy
Mark Rae [MVP] - 18 Sep 2007 15:51 GMT
> 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...

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Andy Fish - 19 Sep 2007 17:31 GMT
session state is not available in the BeginRequest handler

>> i want something that is specific to this request - specifically
>>
[quoted text clipped - 8 lines]
> concurrent requests per se - it is *available* to all requests, which is
> not the same thing...
Mark Rae [MVP] - 19 Sep 2007 17:43 GMT
> session state is not available in the BeginRequest handler

You're quite correct - sorry for the confusion...

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

bruce barker - 18 Sep 2007 16:08 GMT
you want the HttpContext.Items collection. it designed for this.

-- bruce (sqlwork.com)

> Hi,
>
[quoted text clipped - 10 lines]
>
> Andy
Andy Fish - 19 Sep 2007 16:17 GMT
Thanks bruce, sounds perfect

surprised I didn't spot this one when RTFMing :-)

> you want the HttpContext.Items collection. it designed for this.
>
[quoted text clipped - 14 lines]
>>
>> Andy

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.