473,654 Members | 3,097 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

using Session object outside of a WebForm's code-behind

for the code-behind a WebForm, it's easy to use ASP.NET session state --
just refer to the built-in Session object ...

but how to write code elsewhere that utilizes this same object ?

within a WebForm, Session is an instance of the class
System.Web.Sess ionState.HTTPSe ssionState ....

but how to refer to this same object outside of a WebForm's code-behind ?
Nov 17 '05 #1
2 1536
I am not what you mean by outside of a webform.

I create a shared property in the global.vb file and reference by
global.sessioni d.

"John A Grandy" <johnagrandy-at-yahoo.com> wrote in message
news:OK******** ******@TK2MSFTN GP11.phx.gbl...
for the code-behind a WebForm, it's easy to use ASP.NET session state --
just refer to the built-in Session object ...

but how to write code elsewhere that utilizes this same object ?

within a WebForm, Session is an instance of the class
System.Web.Sess ionState.HTTPSe ssionState ....

but how to refer to this same object outside of a WebForm's code-behind ?

Nov 17 '05 #2
Hi John,

System.Web.Http Context.Current .Session

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
and not by private mail.

"John A Grandy" <johnagrandy-at-yahoo.com> wrote in message
news:OK******** ******@TK2MSFTN GP11.phx.gbl...
for the code-behind a WebForm, it's easy to use ASP.NET session state --
just refer to the built-in Session object ...

but how to write code elsewhere that utilizes this same object ?

within a WebForm, Session is an instance of the class
System.Web.Sess ionState.HTTPSe ssionState ....

but how to refer to this same object outside of a WebForm's code-behind ?

Nov 17 '05 #3

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

Similar topics

1
5021
by: Rajesh Abraham | last post by:
I am new to Asp world and I have a doubt as follows. I have a class called objTranslator, which I declare and initiate global.asax as follows. Session_Start csTranslator.objTranslator sesObjTranslator= new objTranslator(); Session=sesObjTranslator; ---------------- Now in WebForm
4
2801
by: Kevin Phifer | last post by:
Ok, before anyone freaks out, I have a solution I need to create that gathers content from maybe different places. Each one can return a <form> in the html, so its the classic can't have more than one runat=server form on a asp.net page. However, I still want developers to be able to use asp.net controls to create some apps that are created on the page. So I need multiple forms on a asp.net page(doesn't everyone). I purchased the...
10
7907
by: Anthony Williams | last post by:
Hi gang, This one looks like a bug :o( As you may or may not know, setting session management in web.config to use cookieless sessions causes the ASP.NET runtime to munge a session ID into the URL, in the format http://yourapplicationpath/(Session.SessionID)/... which saves numerous headaches when it comes to storing state across page requests and sessions.
2
11829
by: charliej2001 | last post by:
Hi all I'm trying to set up an Access database that will be able to import contact information from the lotus notes 6.5 Address book. The idea is that the code runs from access to import all of the contacts, using COM. I've written the following vba code so far to import the contacts
8
1194
by: Andy B | last post by:
Is there a way to refer to things in Session object without calling Session itself?
0
8290
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8815
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8707
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8593
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7306
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5622
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1593
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.