473,322 Members | 1,566 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,322 software developers and data experts.

Use Session in Module

Hi,
does anyone know how can I use the Session inside a module?? I tried

Dim Session As System.Web.SessionState.HttpSessionState

but I got an error......

thanks,
Bruno
Nov 18 '05 #1
5 1363
check out

System.Web.HttpContext.Current.Session

or

System.Web.HttpContext.Current.Cache

etc

"The Clansman" <Yeah! Send me spam!! I love it!! But send the porn ones....>
wrote in message news:Oz**************@tk2msftngp13.phx.gbl...
Hi,
does anyone know how can I use the Session inside a module?? I tried

Dim Session As System.Web.SessionState.HttpSessionState

but I got an error......

thanks,
Bruno

Nov 18 '05 #2
I think you should use httpsession.current.session instead...

"The Clansman" <Yeah! Send me spam!! I love it!! But send the porn ones....>
¦b¶l¥ó news:Oz**************@tk2msftngp13.phx.gbl ¤¤¼¶¼g...
Hi,
does anyone know how can I use the Session inside a module?? I tried

Dim Session As System.Web.SessionState.HttpSessionState

but I got an error......

thanks,
Bruno

Nov 18 '05 #3
Hi,

module in OO world ?

anyway:
dim oSession as HttpSessionState = HttpContext.Current.Session

HTH

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #4
Assume you mean in an HttpModule....

You should note Session state is not available in the BeginRequest event
of an HttpModule, it will not have been loaded, session state is only
available after the AcquireRequestState event.

You can either choose to do your processing later, after the
AcquireRequestState event or you can implement an alternative strategy.
I have used HttpContext.Current.Cache and stored session data that is
required in the beginrequest event in a hashtable with each hashtable
indexed using the sessionID which can be retrieved from the session
cookie (HttpContext.Current.Request.Cookies["ASP.NET_SessionId"].Value).
I am sure this is not the ideal solution but it works well and solved me
no end of headaches!

HTH

Matt

"The Clansman" <Yeah! Send me spam!! I love it!! But send the porn
ones....> wrote in message news:Oz**************@tk2msftngp13.phx.gbl...
Hi,
does anyone know how can I use the Session inside a module?? I tried

Dim Session As System.Web.SessionState.HttpSessionState

but I got an error......

thanks,
Bruno

Nov 18 '05 #5
Thank you all for helping me!!

Bruno

"The Clansman" <Yeah! Send me spam!! I love it!! But send the porn ones....>
wrote in message news:Oz**************@tk2msftngp13.phx.gbl...
Hi,
does anyone know how can I use the Session inside a module?? I tried

Dim Session As System.Web.SessionState.HttpSessionState

but I got an error......

thanks,
Bruno

Nov 18 '05 #6

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

Similar topics

3
by: PM | last post by:
I'm trying to make a kind of search history containing the 3 last searched words. So I'm using 3 Session Variables: Word1 / Word2 / Word3. In order to get this history working, I need to put the...
2
by: moklet | last post by:
i've been trying to create an insert/update trigger on v_$session but with no success. following is my code: 1 create or replace trigger trg_module 2 instead of insert or update on t_$session...
5
by: Phil Grimpo | last post by:
I have a very odd situation here. I have an administration page, where based on a users permissions, a recordset is called from the SQL server which has a list of paths to "Module Menus". Each of...
3
by: WilsonSmith | last post by:
When I use a session variable in a module, it says "Name session is not declared". Is it not possible to use session variable in module? Wilson
4
by: Danny W | last post by:
Hi There! Is it possible to use HttpModule to replace the built-in ASP.NET Session object? I want to write a HttpModule that will handle storing and retrieving of session values from an external...
10
by: thomson | last post by:
Hi, i create a session variable in C# as follows Session , but iam not able to access the variable in VB.net like intmode=Session("var"); Why is that ? Regards
9
by: Randy | last post by:
Hello, I'm having a strange problem. I've got a .NET web app which uses Session variables. Sometime, not all the time, they get cross threaded...that is...one user will have another user's Session...
4
by: semsem22 | last post by:
hello, i m new to ASP.NET, but have experience with VB6....i have a couple of questions about the use of a module and the decleration of public objects in the module vs the use of sessions the...
15
by: =?Utf-8?B?QmVuamFtaW4gSmFuZWNrZQ==?= | last post by:
Hi, we're struggling with a strange session problem in an ASP.NET 2.0 application. The application is used by our customers to access customer-related information such as invoices over the...
4
by: Cirene | last post by:
In my web.config I added <pages enableSessionState="true">. In each of my pages I also added EnableSessionState="True" to the Page declaration. (I didn't think this was necessary, but...) ...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.