473,396 Members | 2,020 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,396 software developers and data experts.

Session State Index

Session state is a collection.
Is it possible to either add or retrieve a value from Session State by
specifying an index number in place of a key ?

If the Session State is initialized with:
Session.add["Pram1"] = Value1;
Session.add["Pram2"] = Value2;

Can they be accessed with ?
myVar1 = Session[0];
myVar2 = Session[1];

Is this even the proper syntax ?

I could not find any documentation on this. If it exists, where is it in
the documentation ?

Thanks in advance for your help,
Jim
Nov 19 '05 #1
3 1074
yes.. Session[0] is valid..

When you type Session[ in Visual Studio, the intellisense itself is showing
this as one of the 2 possible syntaxes ..

For documentaion, MSDN should have some..

"Jim McGivney" wrote:
Session state is a collection.
Is it possible to either add or retrieve a value from Session State by
specifying an index number in place of a key ?

If the Session State is initialized with:
Session.add["Pram1"] = Value1;
Session.add["Pram2"] = Value2;

Can they be accessed with ?
myVar1 = Session[0];
myVar2 = Session[1];

Is this even the proper syntax ?

I could not find any documentation on this. If it exists, where is it in
the documentation ?

Thanks in advance for your help,
Jim

Nov 19 '05 #2
Yes, it is possible. Use square brackets ([]) for C# and regular brackets ()
for VB.NET.

Here is the MSDN documentation:
http://msdn.microsoft.com/library/de...sitemtopic.asp
"Jim McGivney" <mc****@no-spam.sbcglobal.net> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Session state is a collection.
Is it possible to either add or retrieve a value from Session State by
specifying an index number in place of a key ?

If the Session State is initialized with:
Session.add["Pram1"] = Value1;
Session.add["Pram2"] = Value2;

Can they be accessed with ?
myVar1 = Session[0];
myVar2 = Session[1];

Is this even the proper syntax ?

I could not find any documentation on this. If it exists, where is it in
the documentation ?

Thanks in advance for your help,
Jim

Nov 19 '05 #3
if you look at the documentation, you will that Page.Session returns a
HttpSessionState. if you look at the Item property of HttpSessionState, you
will see it supports string and integer indexing.

to look this up in docmentation, in the index i typed Page Class. then i
picked all members. then i picked Session. then i picked Item to get the
answer.

-- bruce (sqlwork.com)

"Jim McGivney" <mc****@no-spam.sbcglobal.net> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Session state is a collection.
Is it possible to either add or retrieve a value from Session State by
specifying an index number in place of a key ?

If the Session State is initialized with:
Session.add["Pram1"] = Value1;
Session.add["Pram2"] = Value2;

Can they be accessed with ?
myVar1 = Session[0];
myVar2 = Session[1];

Is this even the proper syntax ?

I could not find any documentation on this. If it exists, where is it in
the documentation ?

Thanks in advance for your help,
Jim

Nov 19 '05 #4

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

Similar topics

3
by: Nhi Lam | last post by:
Hi, I understand that there are 3 modes in which I can configure the SessionStateModule. What I need is an out of process Session State store with fail over support. The "SQL Server Mode" seems...
5
by: ASP.Confused | last post by:
As you can tell from my previous posts on this issue...I'm really confused :-/ I have a few ASP.NET web applications on my web host's "https" server. Our web host has a single "bin" folder for...
5
by: fbwhite | last post by:
I know this issue has been brought up many times, but I have tried many of the solutions to no avail. I wanted to give my specific case to see if someone could be of any help. We are using the...
2
by: Aaric | last post by:
I am developing my web apps on a Win XP Pro SP2 laptop and then uploading them to a Windows Server 2003. My current project involves using session state variables to keep track of user after they...
5
by: Ĺženol Akbulak | last post by:
Hello; I use in my web application FormsAuthentication. Also I use Session state (InProc). When a user logged in, I can read Session parameters. (For example Session). Problem is that, when...
6
by: Eric McVicker | last post by:
Session state has options to be inproc, state server or sql server. Why does Application state not allow for state server or sql server so the same Application state could be shared between...
11
by: Joseph Geretz | last post by:
I've been looking at two approaches for the maintenance of Session state for a Web Service application. One approach uses the old familiar Session object which I've used in the past for Web...
10
by: =?Utf-8?B?V2FubmFiZQ==?= | last post by:
I've been on this for a while, and cannot figure it out. Can someone please help with this message? SessionState can only be used when EnableSessionState is set to true, either in a...
5
by: =?Utf-8?B?QmlsbHkgWmhhbmc=?= | last post by:
Hi All, I am using asp.net session state service to store session. The concurrent online user will be almost 2000. Could asp.net session state service afford this? Is there any limitation...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
0
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.