Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ASP Error on Session.Contents : Object doesn't support this property or method

79 views
Skip to first unread message

Greg Haley

unread,
Mar 14, 2001, 3:58:34 PM3/14/01
to
I'm getting this error when I try to access Session.Contents from ASP:
"Object doesn't support this property or method: 'Contents' "

I'm running NT 4.0 and IIS 4. I've never seen this error before! The only
thing I can think of that's different about this server is someone installed
VB on it. My guess is that overwrote something. Any ideas?

Thanks!

Jeroen Elias

unread,
Mar 14, 2001, 6:53:06 PM3/14/01
to
Hi Greg,

Leave out the 'Content'
Session("MyVariable") works fine, as it takes the default property "Content"
for you.

Jeroen Elias


"Greg Haley" <gha...@haleyenterprises.com> wrote in message
news:ONwzjkMrAHA.1912@tkmsftngp04...

Nick Katounas

unread,
Mar 14, 2001, 7:40:01 PM3/14/01
to
The reason why you are getting this error is because you cant just access
all the contents by calling Session.Contents... It's not like it is
returning an array or an object .....

Try using it as follows:

Response.Write Session.Contents.Count
Response.Write Session.Contents.Item(1)
Response.Write Session.Contents.Key(USERNAME)

So If you wanted to get all the contents you could retreive them via a loop

i.e For i=1 to i=Session.contents.count
Response.Write Session.Contents.Item(i)
Next

Hope you get my drift.

Nick

Greg Haley <gha...@haleyenterprises.com> wrote in message
news:ONwzjkMrAHA.1912@tkmsftngp04...

Michael Harris

unread,
Mar 14, 2001, 8:56:16 PM3/14/01
to
Post some *actual* simplified code that will reproduce this error. By actual, I mean complete code
(not code snippets) that anyone could copy/paste into a test ASP page and try out...

--
Michael Harris
Microsoft.MVP.Scripting
--
mik...@mvps.org
Please do not email questions - post them to the newsgroup instead.
--

"Greg Haley" <gha...@haleyenterprises.com> wrote in message news:ONwzjkMrAHA.1912@tkmsftngp04...

0 new messages